Skip to content

Commit e760d06

Browse files
tamirdmcgrof
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: Rust-for-Linux#1075 Acked-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Acked-by: Danilo Krummrich <[email protected]> Signed-off-by: Tamir Duberstein <[email protected]>
1 parent 8dcf5be commit e760d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)