Skip to content

Commit e49c43e

Browse files
tamirdojeda
authored andcommitted
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: Rust-for-Linux#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>
1 parent f16a237 commit e49c43e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rust/kernel/miscdevice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl MiscDeviceOptions {
3434
// SAFETY: All zeros is valid for this C type.
3535
let mut result: bindings::miscdevice = unsafe { MaybeUninit::zeroed().assume_init() };
3636
result.minor = bindings::MISC_DYNAMIC_MINOR as ffi::c_int;
37-
result.name = self.name.as_char_ptr();
37+
result.name = crate::str::as_char_ptr_in_const_context(self.name);
3838
result.fops = MiscdeviceVTable::<T>::build();
3939
result
4040
}

0 commit comments

Comments
 (0)