Skip to content

Commit 01b3cb6

Browse files
vireshkgregkh
authored andcommitted
rust: device: Use as_char_ptr() to avoid explicit cast
Use as_char_ptr() to avoid explicit cast. Suggested-by: Alice Ryhl <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/a88cd29bf01c8fbafd5c2608357f54ea10f6e492.1737016320.git.viresh.kumar@linaro.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e1cd24a commit 01b3cb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl Device {
185185
/// Checks if property is present or not.
186186
pub fn property_present(&self, name: &CStr) -> bool {
187187
// SAFETY: By the invariant of `CStr`, `name` is null-terminated.
188-
unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_ptr() as *const _) }
188+
unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_char_ptr()) }
189189
}
190190
}
191191

0 commit comments

Comments
 (0)