From: Viresh Kumar Date: Thu, 16 Jan 2025 08:34:43 +0000 (+0530) Subject: rust: device: Use as_char_ptr() to avoid explicit cast X-Git-Tag: v6.14-rc1~55^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=01b3cb620815fc3feb90ee117d9445a5b608a9f7;p=linux-block.git rust: device: Use as_char_ptr() to avoid explicit cast Use as_char_ptr() to avoid explicit cast. Suggested-by: Alice Ryhl Signed-off-by: Viresh Kumar Reviewed-by: Alice Ryhl Link: https://lore.kernel.org/r/a88cd29bf01c8fbafd5c2608357f54ea10f6e492.1737016320.git.viresh.kumar@linaro.org Signed-off-by: Greg Kroah-Hartman --- 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()) } } }