From: Tamir Duberstein Date: Mon, 22 Dec 2025 12:21:23 +0000 (+0100) Subject: rust: miscdevice: replace `kernel::c_str!` with C-Strings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=582ce8ea201292ecc020505ab258991cdc7d0bd2;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Signed-off-by: Tamir Duberstein Reviewed-by: Daniel Almeida Link: https://patch.msgid.link/20251222-cstr-char-misc-v1-1-d218537d28ab@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/samples/rust/rust_misc_device.rs b/samples/rust/rust_misc_device.rs index d69bc33dbd99f..49dd5814e1abe 100644 --- a/samples/rust/rust_misc_device.rs +++ b/samples/rust/rust_misc_device.rs @@ -98,7 +98,6 @@ use core::pin::Pin; use kernel::{ - c_str, device::Device, fs::{File, Kiocb}, ioctl::{_IO, _IOC_SIZE, _IOR, _IOW}, @@ -133,7 +132,7 @@ impl kernel::InPlaceModule for RustMiscDeviceModule { pr_info!("Initialising Rust Misc Device Sample\n"); let options = MiscDeviceOptions { - name: c_str!("rust-misc-device"), + name: c"rust-misc-device", }; try_pin_init!(Self {