Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: macros: replace `kernel::c_str!` with C-Strings

C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://patch.msgid.link/20251113-core-cstr-cstrings-v3-6-411b34002774@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
bf724be7 ab8a6c7b

+1 -1
+1 -1
rust/macros/module.rs
··· 228 228 type LocalModule = {type_}; 229 229 230 230 impl ::kernel::ModuleMetadata for {type_} {{ 231 - const NAME: &'static ::kernel::str::CStr = ::kernel::c_str!(\"{name}\"); 231 + const NAME: &'static ::kernel::str::CStr = c\"{name}\"; 232 232 }} 233 233 234 234 // Double nested modules, since then nobody can access the public items inside.