Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: auxiliary: 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-driver-core-v1-1-1142a177d0fd@gmail.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Tamir Duberstein and committed by
Danilo Krummrich
6fc4b5eb 9202cef0

+2 -2
+2 -2
samples/rust/rust_driver_auxiliary.rs
··· 5 5 //! To make this driver probe, QEMU must be run with `-device pci-testdev`. 6 6 7 7 use kernel::{ 8 - auxiliary, c_str, 8 + auxiliary, 9 9 device::{Bound, Core}, 10 10 devres::Devres, 11 11 driver, ··· 19 19 use pin_init::PinInit; 20 20 21 21 const MODULE_NAME: &CStr = <LocalModule as kernel::ModuleMetadata>::NAME; 22 - const AUXILIARY_NAME: &CStr = c_str!("auxiliary"); 22 + const AUXILIARY_NAME: &CStr = c"auxiliary"; 23 23 24 24 struct AuxiliaryDriver; 25 25