From e47677020eb52a7ada3560974cf11bcc0ec05859 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 7 Sep 2024 09:53:41 +0100 Subject: [PATCH] vmm: Avoid clippy bool simplification warning Clippy misidentifies this code as having a boolean expression that can be simplified: error: this boolean expression can be simplified Error: --> vmm/src/cpu.rs:425:13 | 425 | is_aarch64_feature_detected!("sve") || is_aarch64_feature_detected!("sve2"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool = note: `-D clippy::nonminimal-bool` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]` help: try | 425 | !(!cfg!(target_feature = $target_feature_lit) && !$crate::detect::__is_feature_detected::$feature() && !$crate::detect::__is_feature_detected::$feature()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 425 | is_aarch64_feature_detected!("sve") || is_aarch64_feature_detected!("sve") || is_aarch64_feature_detected!("sve2"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Rob Bradford --- vmm/src/cpu.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index f71212b48..5125aac24 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -421,6 +421,7 @@ impl Vcpu { pub fn init(&self, vm: &Arc) -> Result<()> { use std::arch::is_aarch64_feature_detected; let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default(); + #[allow(clippy::nonminimal_bool)] let sve_supported = is_aarch64_feature_detected!("sve") || is_aarch64_feature_detected!("sve2"); // This reads back the kernel's preferred target type.