Re: [PATCH v2] rust/kernel: Add faux device bindings

From: Miguel Ojeda
Date: Fri Feb 07 2025 - 06:43:57 EST


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.

Thanks!

Cheers,
Miguel