[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251222-cstr-char-misc-v1-1-d218537d28ab@gmail.com>
Date: Mon, 22 Dec 2025 13:21:23 +0100
From: Tamir Duberstein <tamird@...nel.org>
To: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Tamir Duberstein <tamird@...il.com>
Subject: [PATCH] rust: miscdevice: replace `kernel::c_str!` with C-Strings
From: Tamir Duberstein <tamird@...il.com>
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@...uxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Benno Lossin <lossin@...nel.org>
Signed-off-by: Tamir Duberstein <tamird@...il.com>
---
samples/rust/rust_misc_device.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/samples/rust/rust_misc_device.rs b/samples/rust/rust_misc_device.rs
index d69bc33dbd99..49dd5814e1ab 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 @@ fn init(_module: &'static ThisModule) -> impl PinInit<Self, Error> {
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 {
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-char-misc-0f4144d0a7b2
Best regards,
--
Tamir Duberstein <tamird@...il.com>
Powered by blists - more mailing lists