[PATCH] rust: pl011: fix warning with new clippy

Paolo Bonzini posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251009211148.642966-1-pbonzini@redhat.com
Maintainers: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
rust/hw/char/pl011/src/registers.rs | 1 +
1 file changed, 1 insertion(+)
[PATCH] rust: pl011: fix warning with new clippy
Posted by Paolo Bonzini 1 month ago
Newer versions of clippy are able to see that all the variants in
the PL011 word length enum end with "Bits", and complain about it.
Allow it.

Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/hw/char/pl011/src/registers.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/hw/char/pl011/src/registers.rs b/rust/hw/char/pl011/src/registers.rs
index 0c3a4d7d214..fa572811b29 100644
--- a/rust/hw/char/pl011/src/registers.rs
+++ b/rust/hw/char/pl011/src/registers.rs
@@ -255,6 +255,7 @@ pub enum Mode {
 
 #[bitsize(2)]
 #[derive(Clone, Copy, Debug, Eq, FromBits, PartialEq)]
+#[allow(clippy::enum_variant_names)]
 /// `WLEN` Word length, field of [Line Control register](LineControl).
 ///
 /// These bits indicate the number of data bits transmitted or received in a
-- 
2.51.0
Re: [PATCH] rust: pl011: fix warning with new clippy
Posted by Manos Pitsidianakis 1 month ago
On Fri, Oct 10, 2025 at 12:12 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Newer versions of clippy are able to see that all the variants in
> the PL011 word length enum end with "Bits", and complain about it.
> Allow it.
>
> Reported-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>


>  rust/hw/char/pl011/src/registers.rs | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/rust/hw/char/pl011/src/registers.rs b/rust/hw/char/pl011/src/registers.rs
> index 0c3a4d7d214..fa572811b29 100644
> --- a/rust/hw/char/pl011/src/registers.rs
> +++ b/rust/hw/char/pl011/src/registers.rs
> @@ -255,6 +255,7 @@ pub enum Mode {
>
>  #[bitsize(2)]
>  #[derive(Clone, Copy, Debug, Eq, FromBits, PartialEq)]
> +#[allow(clippy::enum_variant_names)]
>  /// `WLEN` Word length, field of [Line Control register](LineControl).
>  ///
>  /// These bits indicate the number of data bits transmitted or received in a
> --
> 2.51.0
>
>