Commit 01b3cb62 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

rust: device: Use as_char_ptr() to avoid explicit cast

parent e1cd24af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ unsafe fn printk(&self, klevel: &[u8], msg: fmt::Arguments<'_>) {
    /// Checks if property is present or not.
    pub fn property_present(&self, name: &CStr) -> bool {
        // SAFETY: By the invariant of `CStr`, `name` is null-terminated.
        unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_ptr() as *const _) }
        unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_char_ptr()) }
    }
}