Re: [PATCH v2] rust: update `kernel::c_str!` documentation
From: Tamir Duberstein
Date: Thu Mar 12 2026 - 09:25:08 EST
On Tue, Mar 10, 2026 at 1:57 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> On Mon Mar 9, 2026 at 5:01 PM GMT, Tamir Duberstein wrote:
> > Now that all literals are C-Strings, update the documentation to explain
> > that use of this macro should be limited to non-literal strings.
> >
> > Link: https://github.com/Rust-for-Linux/linux/issues/1075
> > Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxxx>
> > ---
> > This patch completes the work of replacing our custom `CStr` with
> > upstream's.
> > ---
> > Changes in v2:
> > - Drop rename, keep only documentation update. (Gary Guo)
> > - Add example of misuse to documentation. (Gary Guo)
> > - Link to v1: https://patch.msgid.link/20260302-cstr-rename-macro-v1-1-a269fe4dc3f0@xxxxxxxxxx
>
> The lint for `c_str!("literal")` now lands in klint:
>
> https://github.com/Rust-for-Linux/klint/commit/69fa3560e28031faa8c5a93e1ac95cc2b3689306
>
> Best,
> Gary
Very cool, thanks!