diff options
author | Tamir Duberstein <tamird@gmail.com> | 2025-08-13 11:42:01 -0400 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2025-09-16 09:26:59 +0200 |
commit | 5749cd1ed8bd11e99ba87146d117e711a4a38f30 (patch) | |
tree | b56f5029f4a2a5e55f1914f0c1ff68fee2684d19 /rust/kernel | |
parent | 182d95571ffa278f7c68a80d76de88a5333fb69f (diff) |
rust: of: 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/of.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/of.rs b/rust/kernel/of.rs index b76b35265df2..58b20c367f99 100644 --- a/rust/kernel/of.rs +++ b/rust/kernel/of.rs @@ -34,7 +34,7 @@ unsafe impl RawDeviceIdIndex for DeviceId { impl DeviceId { /// Create a new device id from an OF 'compatible' string. pub const fn new(compatible: &'static CStr) -> Self { - let src = compatible.as_bytes_with_nul(); + let src = compatible.to_bytes_with_nul(); // Replace with `bindings::of_device_id::default()` once stabilized for `const`. // SAFETY: FFI type is valid to be zero-initialized. let mut of: bindings::of_device_id = unsafe { core::mem::zeroed() }; |