summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2025-01-16 14:04:43 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-16 11:07:27 +0100
commit01b3cb620815fc3feb90ee117d9445a5b608a9f7 (patch)
tree3b69bff13893be6ea9b8b6b119921a631bd13ba0 /rust/kernel
parente1cd24af8ff2ad7e26e1711be3d7bd72eef24279 (diff)
rust: device: Use as_char_ptr() to avoid explicit cast
Use as_char_ptr() to avoid explicit cast. Suggested-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/a88cd29bf01c8fbafd5c2608357f54ea10f6e492.1737016320.git.viresh.kumar@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/device.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index c6823decbb2e..e7a2024b88d5 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -185,7 +185,7 @@ impl Device {
/// 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()) }
}
}