Re: [PATCH] rust: kernel: document safety for rust_fmt_argument

From: Miguel Ojeda

Date: Tue Feb 10 2026 - 10:01:00 EST


On Wed, Jan 28, 2026 at 9:21 PM Shivendra Sharma
<shivendra02467@xxxxxxxxx> wrote:
>
> Currently, `rust_fmt_argument` uses a TODO for its safety rationale and
> suppresses the `missing_safety_doc` clippy warning.
>
> Following feedback from a previous attempt [1], replace the
> suppression with a formal "# Safety" section and update the internal
> "// SAFETY" comments to reference these requirements. Additionally,
> add a comment to the C header file pointing to the Rust documentation
> for safety preconditions.
>
> [1] https://lore.kernel.org/rust-for-linux/CANiq72=b=Z+6dk4XWK6QWcKDJx7SYXL0obAFFfWp8xpE1CFkkw@xxxxxxxxxxxxxx/
>
> Signed-off-by: Shivendra Sharma <shivendra02467@xxxxxxxxx>

Related:

https://lore.kernel.org/rust-for-linux/20260205042132.40772-1-muchamadcoirulanwar@xxxxxxxxx/

Cc'ing Muchamad.

Could you (i.e. both) please coordinate the patches, perhaps merging
them into a single series? You may want to use Co-developed-by and/or
have a different author per patch etc.

Thanks!

Cheers,
Miguel