From: Tamir Duberstein Date: Thu, 13 Nov 2025 22:58:29 +0000 (-0500) Subject: rust: macros: replace `kernel::c_str!` with C-Strings X-Git-Tag: v6.19-rc1~175^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf724be7f00cf2cbafc105422476f6242e917a90;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Signed-off-by: Tamir Duberstein Link: https://patch.msgid.link/20251113-core-cstr-cstrings-v3-6-411b34002774@gmail.com Signed-off-by: Miguel Ojeda --- diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 5ee54a00c0b65..8cef6cc958b54 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -228,7 +228,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { type LocalModule = {type_}; impl ::kernel::ModuleMetadata for {type_} {{ - const NAME: &'static ::kernel::str::CStr = ::kernel::c_str!(\"{name}\"); + const NAME: &'static ::kernel::str::CStr = c\"{name}\"; }} // Double nested modules, since then nobody can access the public items inside.