Skip to content

Commit 7ad635c

Browse files
tamirdojeda
authored andcommitted
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: 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 7dfabaa commit 7ad635c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rust/kernel/auxiliary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ pub struct DeviceId(bindings::auxiliary_device_id);
105105
impl DeviceId {
106106
/// Create a new [`DeviceId`] from name.
107107
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();
110110

111111
// TODO: Replace with `bindings::auxiliary_device_id::default()` once stabilized for
112112
// `const`.

0 commit comments

Comments
 (0)