Rust-for-Linux / linux

Adding support for the Rust language to the Linux kernel.
https://rust-for-linux.com
Other
3.95k stars 421 forks source link

Clean all the Clippy warnings in `drivers/gpu/drm/drm_panic_qr.rs` #1123

Open ojeda opened 1 day ago

ojeda commented 1 day ago

Clean all the Clippy warnings in drivers/gpu/drm/drm_panic_qr.rs.

The DRM maintainers will need to be involved, since the patch will go through them. For some warnings, there may be different ways of solving it, so it may require figuring out the best way for each for them.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Reported-by: tag and a Closes: tag to this issue. Please see https://rust-for-linux.com/contributing for details.

Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.

GuilhermeGiacomoSimoes commented 22 hours ago

I don't is specialist in clippy ... But , how I can run the clippy on the linux kernel without Cargo.toml ? Can I isolate the rust code in another directory and create the Cargo.toml and run Clippy ?

tgross35 commented 22 hours ago

All the Rust tools work without Cargo - clippy_driver is a direct drop in for rustc. Just build with CLIPPY=1 :)

Witcher01 commented 21 hours ago

I'm relatively new to kernel development so I'll leave this here if anyone is stumbling a little as well: Don't forget to enable DRM_PANIC_SCREEN_QR_CODE in .config so the relevant code compiled in the first place and build with make LLVM=1 CLIPPY=1 drivers/gpu/drm/`.

@GuilhermeGiacomoSimoes Do you want to work on this? If not, I'd like to implement this and make my first contribution to the kernel!

GuilhermeGiacomoSimoes commented 5 hours ago

Okay @Witcher01 , you can make resolve this issue. I take another issue.