Re: [PATCH v2] rust/kernel: Add faux device bindings
From: Greg Kroah-Hartman
Date: Fri Feb 07 2025 - 07:17:33 EST
On Fri, Feb 07, 2025 at 12:42:41PM +0100, Miguel Ojeda wrote:
> On Fri, Feb 7, 2025 at 1:42 AM Lyude Paul <lyude@xxxxxxxxxx> wrote:
> >
> > This introduces a crate for working with faux devices in rust, along with
>
> s/crate/module
>
> (also in the module description)
>
> > +//! C header: [`include/linux/device/faux.h`]
> > +use crate::{bindings, device, error::code::*, prelude::*};
>
> Newline between.
>
> > + // SAFETY: self.0 is a valid registered faux_device via our type invariants.
>
> Markdown.
>
> > +// SAFETY: The faux device API is thread-safe
> > +unsafe impl Send for Registration {}
> > +
> > +// SAFETY: The faux device API is thread-safe
> > +unsafe impl Sync for Registration {}
>
> Perhaps some extra notes here would be useful, e.g. is it documented
> to be so? Especially since faux is being added now, it may make sense
> to e.g. take the chance to work on mentioning this on the C side.
How can or should I mention this on the C side?
thanks,
greg k-h