[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025011556-regroup-swapping-623a@gregkh>
Date: Wed, 15 Jan 2025 09:09:04 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH V7 03/16] rust: cpu: Add from_cpu()
On Wed, Jan 15, 2025 at 01:28:59PM +0530, Viresh Kumar wrote:
> On 15-01-25, 08:54, Greg KH wrote:
> > Ah, but that's not really something that SAFETY should override, right?
> >
> > Yes, you know your implementation of this will stop using the pointer in
> > the hotplug callback before it goes away but that's not documented here.
> > And having the device "fail" afterward isn't really ok either as you are
> > relying on the driver core to always check for this and I'm not so sure
> > that it always does on all codepaths.
> >
> > But, I'm ok with this for now, as you are just copying the bad C model
> > at the moment, but it really feels like a huge foot-gun waiting to go
> > off. Any way to put some more documentation here as in "use this at
> > your own risk!"?
>
> What about marking it unsafe ? That would require callers to document
> why it is safe to call this. And yes add more documentation here too.
Sure, that's fine with me.
Powered by blists - more mailing lists