diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2025-11-13 17:58:29 -0500 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2025-11-17 00:59:21 +0100 |
| commit | bf724be7f00cf2cbafc105422476f6242e917a90 (patch) | |
| tree | 54d96c7563e479ea420de098db9419f107bcda4c /rust | |
| parent | ab8a6c7b34513e48eb4fa766daaa81e75e4306ed (diff) | |
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>
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/macros/module.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 5ee54a00c0b6..8cef6cc958b5 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. |