Skip to contentSkip to conversation

rust: pl011: use default set of lints

PATCH In review Paolo Bonzini 2 participants 2 messages Feb 7, 2025 – Feb 10, 2025 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: pl011: use default set of lints

Being the first crate added to QEMU, pl011 has a rather restrictive Clippy setup. This can be sometimes a bit too heavy on its suggestions, for example

error: this could be a const fn
--> hw/char/pl011/src/device.rs:382:5

    |
382 | /     fn set_read_trigger(&mut self) {
383 | |         self.read_trigger = 1;
384 | |     }
    | |_____^

Just use the standard set that is present in rust/Cargo.toml, with just a small adjustment to allow upper case acronyms which are used for register names.

---
 rust/hw/char/pl011/src/lib.rs | 9 ---------
 1 file changed, 9 deletions(-)
rust/hw/char/pl011/src/lib.rs +0 -9
index 88452dc888c..1bf46c65af2 100644
@@ -12,16 +12,7 @@
 //! See [`PL011State`](crate::device::PL011State) for the device model type and
 //! the [`registers`] module for register types.
 
-#![deny(
-    clippy::correctness,
-    clippy::suspicious,
-    clippy::complexity,
-    clippy::perf,
-    clippy::nursery,
-    clippy::style
-)]
 #![allow(clippy::upper_case_acronyms)]
-#![allow(clippy::result_unit_err)]
 
 use qemu_api::c_str;
 
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Paolo Bonzini

Being the first crate added to QEMU, pl011 has a rather restrictive Clippy setup. This can be sometimes a bit too heavy on its suggestions, for example

error: this could be a const fn
--> hw/char/pl011/src/device.rs:382:5

    |
382 | /     fn set_read_trigger(&mut self) {
383 | |         self.read_trigger = 1;
384 | |     }
    | |_____^

Just use the standard set that is present in rust/Cargo.toml, with just a small adjustment to allow upper case acronyms which are used for register names.

Quoted 5 lines
---
 rust/hw/char/pl011/src/lib.rs | 9 ---------
 1 file changed, 9 deletions(-)

(I'm late, don't worry if my R-b gets lost.)

Quoted 26 lines
rust/hw/char/pl011/src/lib.rs +0 -10
index 88452dc888c..1bf46c65af2 100644
@@ -12,16 +12,7 @@
 //! See [`PL011State`](crate::device::PL011State) for the device model type and
 //! the [`registers`] module for register types.
 
-#![deny(
-    clippy::correctness,
-    clippy::suspicious,
-    clippy::complexity,
-    clippy::perf,
-    clippy::nursery,
-    clippy::style
-)]
 #![allow(clippy::upper_case_acronyms)]
-#![allow(clippy::result_unit_err)]
 
 use qemu_api::c_str;
 
--

2.48.1