mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
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:
parent
185c81461f
commit
43e3518582
1 changed files with 6 additions and 2 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue