mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
rust: irq: 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. Signed-off-by: Tamir Duberstein <tamird@gmail.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20251222-cstr-driver-core-v1-5-1142a177d0fd@gmail.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
0250ea325c
commit
644672e93a
|
|
@ -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)?;
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user