mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 00:28:54 +02:00
samples: rust: pci: 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-pci-v1-1-a0397c61bbe4@gmail.com [ Use kernel vertical import style. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
652ff12476
commit
185c81461f
|
|
@ -4,7 +4,13 @@
|
|||
//!
|
||||
//! To make this driver probe, QEMU must be run with `-device pci-testdev`.
|
||||
|
||||
use kernel::{c_str, device::Core, devres::Devres, pci, prelude::*, sync::aref::ARef};
|
||||
use kernel::{
|
||||
device::Core,
|
||||
devres::Devres,
|
||||
pci,
|
||||
prelude::*,
|
||||
sync::aref::ARef, //
|
||||
};
|
||||
|
||||
struct Regs;
|
||||
|
||||
|
|
@ -79,7 +85,7 @@ fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> impl PinInit<Self, Er
|
|||
pdev.set_master();
|
||||
|
||||
Ok(try_pin_init!(Self {
|
||||
bar <- pdev.iomap_region_sized::<{ Regs::END }>(0, c_str!("rust_driver_pci")),
|
||||
bar <- pdev.iomap_region_sized::<{ Regs::END }>(0, c"rust_driver_pci"),
|
||||
index: *info,
|
||||
_: {
|
||||
let bar = bar.access(pdev.as_ref())?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user