Skip to content

Commit 8dcf5be

Browse files
tamirdmcgrof
authored andcommitted
rust: net: 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 446e471 commit 8dcf5be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/net/phy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ unsafe impl Sync for DriverVTable {}
497497
pub const fn create_phy_driver<T: Driver>() -> DriverVTable {
498498
// INVARIANT: All the fields of `struct phy_driver` are initialized properly.
499499
DriverVTable(Opaque::new(bindings::phy_driver {
500-
name: T::NAME.as_char_ptr().cast_mut(),
500+
name: crate::str::as_char_ptr_in_const_context(T::NAME).cast_mut(),
501501
flags: T::FLAGS,
502502
phy_id: T::PHY_DEVICE_ID.id(),
503503
phy_id_mask: T::PHY_DEVICE_ID.mask_as_int(),

0 commit comments

Comments
 (0)