Re: [PATCH] rust: miscdevice: fix warning on c_uint to u32 cast

From: Greg Kroah-Hartman
Date: Tue Oct 15 2024 - 13:09:05 EST


On Tue, Oct 15, 2024 at 02:13:22PM +0000, Alice Ryhl wrote:
> When building miscdevice with clippy warnings, the following warning is
> emitted:
>
> warning: casting to the same type is unnecessary (`u32` -> `u32`)
> --> /home/aliceryhl/rust-for-linux/rust/kernel/miscdevice.rs:220:28
> |
> 220 | match T::ioctl(device, cmd as u32, arg as usize) {
> | ^^^^^^^^^^ help: try: `cmd`
> |
> = help: for further information visit
> https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
> = note: `-W clippy::unnecessary-cast` implied by `-W clippy::all`
> = help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_cast)]`
>
> Thus, fix it.
>
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> ---
> This fixes a warning on my patches in char-misc-next. Greg, can you take
> this through that tree?

Will do, thanks!

greg k-h