Skip to content

Commit 5749cd1

Browse files
tamirdojeda
authored andcommitted
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: #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 182d955 commit 5749cd1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rust/kernel/of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unsafe impl RawDeviceIdIndex for DeviceId {
3434
impl DeviceId {
3535
/// Create a new device id from an OF 'compatible' string.
3636
pub const fn new(compatible: &'static CStr) -> Self {
37-
let src = compatible.as_bytes_with_nul();
37+
let src = compatible.to_bytes_with_nul();
3838
// Replace with `bindings::of_device_id::default()` once stabilized for `const`.
3939
// SAFETY: FFI type is valid to be zero-initialized.
4040
let mut of: bindings::of_device_id = unsafe { core::mem::zeroed() };

0 commit comments

Comments
 (0)