mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
rust: seq_file: 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/20251222-cstr-vfs-v1-1-18e3d327cbd7@gmail.com Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
fd5d8b65cf
commit
40210c2b11
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
//!
|
||||
//! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
|
||||
|
||||
use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
|
||||
use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
|
||||
|
||||
/// A utility for generating the contents of a seq file.
|
||||
#[repr(transparent)]
|
||||
|
|
@ -36,7 +36,7 @@ impl SeqFile {
|
|||
unsafe {
|
||||
bindings::seq_printf(
|
||||
self.inner.get(),
|
||||
c_str!("%pA").as_char_ptr(),
|
||||
c"%pA".as_char_ptr(),
|
||||
core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue