Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: auxiliary: 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>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
7ad635c9 7dfabaa0

+2 -2
+2 -2
rust/kernel/auxiliary.rs
··· 105 105 impl DeviceId { 106 106 /// Create a new [`DeviceId`] from name. 107 107 pub const fn new(modname: &'static CStr, name: &'static CStr) -> Self { 108 - let name = name.as_bytes_with_nul(); 109 - let modname = modname.as_bytes_with_nul(); 108 + let name = name.to_bytes_with_nul(); 109 + let modname = modname.to_bytes_with_nul(); 110 110 111 111 // TODO: Replace with `bindings::auxiliary_device_id::default()` once stabilized for 112 112 // `const`.