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: miscdevice: 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>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20251222-cstr-char-misc-v1-1-d218537d28ab@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tamir Duberstein and committed by
Greg Kroah-Hartman
582ce8ea c1ea3120

+1 -2
+1 -2
samples/rust/rust_misc_device.rs
··· 98 98 use core::pin::Pin; 99 99 100 100 use kernel::{ 101 - c_str, 102 101 device::Device, 103 102 fs::{File, Kiocb}, 104 103 ioctl::{_IO, _IOC_SIZE, _IOR, _IOW}, ··· 132 133 pr_info!("Initialising Rust Misc Device Sample\n"); 133 134 134 135 let options = MiscDeviceOptions { 135 - name: c_str!("rust-misc-device"), 136 + name: c"rust-misc-device", 136 137 }; 137 138 138 139 try_pin_init!(Self {