Skip to content

Commit bf724be

Browse files
tamirdojeda
authored andcommitted
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>
1 parent ab8a6c7 commit bf724be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/macros/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
228228
type LocalModule = {type_};
229229
230230
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}\";
232232
}}
233233
234234
// Double nested modules, since then nobody can access the public items inside.

0 commit comments

Comments
 (0)