Skip to content

Commit 182d955

Browse files
tamirdojeda
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: #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 e49c43e commit 182d955

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)