summaryrefslogtreecommitdiff
path: root/rust/kernel/print.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2024-09-13 22:29:25 +0100
committerMiguel Ojeda <ojeda@kernel.org>2024-12-16 21:49:33 +0100
commit9b98be76855f14bd5180b59c1ac646b5add98f33 (patch)
tree3c8c24beff105fcec183d6a70d247f8e74599434 /rust/kernel/print.rs
parent1bae8729e50a900f41e9a1c17ae81113e4cf62b8 (diff)
rust: cleanup unnecessary casts
With `long` mapped to `isize`, `size_t`/`__kernel_size_t` mapped to `usize` and `char` mapped to `u8`, many of the existing casts are no longer necessary. Signed-off-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240913213041.395655-6-gary@garyguo.net [ Moved `uaccess` changes to the previous commit, since they were irrefutable patterns that Rust >= 1.82.0 warns about. Removed a couple casts that now use `c""` literals. Rebased on top of `rust-next`. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/print.rs')
-rw-r--r--rust/kernel/print.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/print.rs b/rust/kernel/print.rs
index a28077a7cb30..b19ee490be58 100644
--- a/rust/kernel/print.rs
+++ b/rust/kernel/print.rs
@@ -107,7 +107,7 @@ pub unsafe fn call_printk(
// SAFETY: TODO.
unsafe {
bindings::_printk(
- format_string.as_ptr() as _,
+ format_string.as_ptr(),
module_name.as_ptr(),
&args as *const _ as *const c_void,
);
@@ -128,7 +128,7 @@ pub fn call_printk_cont(args: fmt::Arguments<'_>) {
#[cfg(CONFIG_PRINTK)]
unsafe {
bindings::_printk(
- format_strings::CONT.as_ptr() as _,
+ format_strings::CONT.as_ptr(),
&args as *const _ as *const c_void,
);
}