diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2025-12-22 13:12:20 +0100 |
|---|---|---|
| committer | Andreas Hindborg <a.hindborg@kernel.org> | 2026-01-15 09:26:49 +0100 |
| commit | 1d40cb05e077bb294f128c6a52630b93e452a8ed (patch) | |
| tree | d00b4a177bcfa3b2fcf413af08d921afa9a8999f /samples | |
| parent | 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb (diff) | |
rust: configfs: 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>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20251222-cstr-configfs-v1-1-cc1665c51c43@gmail.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/rust/rust_configfs.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/rust/rust_configfs.rs b/samples/rust/rust_configfs.rs index 0ccc7553ef39..a1bd9db6010d 100644 --- a/samples/rust/rust_configfs.rs +++ b/samples/rust/rust_configfs.rs @@ -3,7 +3,6 @@ //! Rust configfs sample. use kernel::alloc::flags; -use kernel::c_str; use kernel::configfs; use kernel::configfs::configfs_attrs; use kernel::new_mutex; @@ -35,7 +34,7 @@ struct Configuration { impl Configuration { fn new() -> impl PinInit<Self, Error> { try_pin_init!(Self { - message: c_str!("Hello World\n"), + message: c"Hello World\n", bar <- new_mutex!((KBox::new([0; PAGE_SIZE], flags::GFP_KERNEL)?, 0)), }) } @@ -61,7 +60,7 @@ impl kernel::InPlaceModule for RustConfigfs { try_pin_init!(Self { config <- configfs::Subsystem::new( - c_str!("rust_configfs"), item_type, Configuration::new() + c"rust_configfs", item_type, Configuration::new() ), }) } |
