samples: rust: faux: 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>
Link: https://patch.msgid.link/20251223-cstr-faux-v1-1-ee0c5cf1be4b@gmail.com
[ Use kernel vertical import style. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
Tamir Duberstein 2025-12-23 08:40:24 +01:00 committed by Danilo Krummrich
parent 185c81461f
commit 43e3518582

View file

@ -2,7 +2,11 @@
//! Rust faux device sample.
use kernel::{c_str, faux, prelude::*, Module};
use kernel::{
faux,
prelude::*,
Module, //
};
module! {
type: SampleModule,
@ -20,7 +24,7 @@ impl Module for SampleModule {
fn init(_module: &'static ThisModule) -> Result<Self> {
pr_info!("Initialising Rust Faux Device Sample\n");
let reg = faux::Registration::new(c_str!("rust-faux-sample-device"), None)?;
let reg = faux::Registration::new(c"rust-faux-sample-device", None)?;
dev_info!(reg.as_ref(), "Hello from faux device!\n");