Re: [PATCH 2/2] rust/faux: Add missing parent argument to Registration::new()

From: Greg KH
Date: Wed Feb 26 2025 - 06:02:54 EST


On Wed, Feb 26, 2025 at 11:39:31AM +0100, Danilo Krummrich wrote:
> > > I think if we want to add something to the safety comment, it should be somthing
> > > along the line of "the type of `parent` implies that for the duration of this
> > > call `parent` is a valid device with a non-zero reference count".
> >
> > I don't understand the need for any safety comment about the parent
> > here. Again, as long as it is valid when the call is made, that is all
> > that is needed.
>
> Right, and we could mention that in the safety comment that something of the
> type `&device::Device` is indeed valid by definition and hence fullfills the
> requirement of faux_device_create() to get a valid pointer (or NULL).

Agreed. I'll go apply patch 1 of the series now and wait for a new
version of 2/2.

thanks!

greg k-h