diff options
author | Tamir Duberstein <tamird@gmail.com> | 2025-08-13 11:41:59 -0400 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2025-09-16 09:26:59 +0200 |
commit | e49c43ef82f57a155a6c1e6c79795abff1227f29 (patch) | |
tree | c585cb06b8ae13626bd2f68eb30b450045abe174 /rust/kernel | |
parent | f16a23743ef57e42985bb934a7d511cddb82b868 (diff) |
rust: miscdevice: use `core::ffi::CStr` method names
Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by
avoid methods that only exist on the latter.
Link: https://github.com/Rust-for-Linux/linux/issues/1075
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>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel')
-rw-r--r-- | rust/kernel/miscdevice.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs index 6373fe183b27..d3aa7d25afad 100644 --- a/rust/kernel/miscdevice.rs +++ b/rust/kernel/miscdevice.rs @@ -34,7 +34,7 @@ impl MiscDeviceOptions { // SAFETY: All zeros is valid for this C type. let mut result: bindings::miscdevice = unsafe { MaybeUninit::zeroed().assume_init() }; result.minor = bindings::MISC_DYNAMIC_MINOR as ffi::c_int; - result.name = self.name.as_char_ptr(); + result.name = crate::str::as_char_ptr_in_const_context(self.name); result.fops = MiscdeviceVTable::<T>::build(); result } |