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: firmware: 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>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://patch.msgid.link/20251113-core-cstr-cstrings-v3-1-411b34002774@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
305b7957 f56b1317

+3 -3
+3 -3
rust/kernel/firmware.rs
··· 51 51 /// # Examples 52 52 /// 53 53 /// ```no_run 54 - /// # use kernel::{c_str, device::Device, firmware::Firmware}; 54 + /// # use kernel::{device::Device, firmware::Firmware}; 55 55 /// 56 56 /// # fn no_run() -> Result<(), Error> { 57 57 /// # // SAFETY: *NOT* safe, just for the example to get an `ARef<Device>` instance 58 58 /// # let dev = unsafe { Device::get_device(core::ptr::null_mut()) }; 59 59 /// 60 - /// let fw = Firmware::request(c_str!("path/to/firmware.bin"), &dev)?; 60 + /// let fw = Firmware::request(c"path/to/firmware.bin", &dev)?; 61 61 /// let blob = fw.data(); 62 62 /// 63 63 /// # Ok(()) ··· 204 204 ($($builder:tt)*) => { 205 205 const _: () = { 206 206 const __MODULE_FIRMWARE_PREFIX: &'static $crate::str::CStr = if cfg!(MODULE) { 207 - $crate::c_str!("") 207 + c"" 208 208 } else { 209 209 <LocalModule as $crate::ModuleMetadata>::NAME 210 210 };