[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251222-cstr-driver-core-v1-5-1142a177d0fd@gmail.com>
Date: Mon, 22 Dec 2025 13:35:31 +0100
From: Tamir Duberstein <tamird@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dave Ertman <david.m.ertman@...el.com>, Ira Weiny <ira.weiny@...el.com>,
Leon Romanovsky <leon@...nel.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>, "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Almeida <daniel.almeida@...labora.com>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Tamir Duberstein <tamird@...il.com>
Subject: [PATCH 5/7] rust: irq: 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.
Signed-off-by: Tamir Duberstein <tamird@...il.com>
---
rust/kernel/irq/request.rs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/irq/request.rs b/rust/kernel/irq/request.rs
index b150563fdef8..67769800117c 100644
--- a/rust/kernel/irq/request.rs
+++ b/rust/kernel/irq/request.rs
@@ -139,7 +139,6 @@ pub fn irq(&self) -> u32 {
/// [`Completion::wait_for_completion()`]: kernel::sync::Completion::wait_for_completion
///
/// ```
-/// use kernel::c_str;
/// use kernel::device::{Bound, Device};
/// use kernel::irq::{self, Flags, IrqRequest, IrqReturn, Registration};
/// use kernel::prelude::*;
@@ -167,7 +166,7 @@ pub fn irq(&self) -> u32 {
/// handler: impl PinInit<Data, Error>,
/// request: IrqRequest<'_>,
/// ) -> Result<Arc<Registration<Data>>> {
-/// let registration = Registration::new(request, Flags::SHARED, c_str!("my_device"), handler);
+/// let registration = Registration::new(request, Flags::SHARED, c"my_device", handler);
///
/// let registration = Arc::pin_init(registration, GFP_KERNEL)?;
///
@@ -340,7 +339,6 @@ fn handle_threaded(&self, device: &Device<Bound>) -> IrqReturn {
/// [`Mutex`](kernel::sync::Mutex) to provide interior mutability.
///
/// ```
-/// use kernel::c_str;
/// use kernel::device::{Bound, Device};
/// use kernel::irq::{
/// self, Flags, IrqRequest, IrqReturn, ThreadedHandler, ThreadedIrqReturn,
@@ -381,7 +379,7 @@ fn handle_threaded(&self, device: &Device<Bound>) -> IrqReturn {
/// request: IrqRequest<'_>,
/// ) -> Result<Arc<ThreadedRegistration<Data>>> {
/// let registration =
-/// ThreadedRegistration::new(request, Flags::SHARED, c_str!("my_device"), handler);
+/// ThreadedRegistration::new(request, Flags::SHARED, c"my_device", handler);
///
/// let registration = Arc::pin_init(registration, GFP_KERNEL)?;
///
--
2.52.0
Powered by blists - more mailing lists