summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-12-23 08:40:24 +0100
committerDanilo Krummrich <dakr@kernel.org>2025-12-23 11:44:36 +0100
commit43e3518582cfc0fc1bb536b62d7f8366ee069ce9 (patch)
treef41960267fe72fc3635948c9332b349215bb461d /samples
parent185c81461ff4987d35fdfc4c8da46ae51ee5ada4 (diff)
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/rust/rust_driver_faux.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/samples/rust/rust_driver_faux.rs b/samples/rust/rust_driver_faux.rs
index ecc9fd378cbd..5330b77ea986 100644
--- a/samples/rust/rust_driver_faux.rs
+++ b/samples/rust/rust_driver_faux.rs
@@ -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");