mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +00:00
arch: aarch64: Fix beta clippy issue
error: unneeded late initalization Error: --> arch/src/aarch64/gic/gicv3_its.rs:127:9 | 127 | let attr: u64; | ^^^^^^^^^^^^^^ | = note: `-D clippy::needless-late-init` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `attr` here | 128 | let attr: u64 = if save { | +++++++++++++++ help: remove the assignments from the branches | 129 ~ u64::from(kvm_bindings::KVM_DEV_ARM_ITS_SAVE_TABLES) 130 | } else { 131 ~ u64::from(kvm_bindings::KVM_DEV_ARM_ITS_RESTORE_TABLES) | help: add a semicolon after the `if` expression | 132 | }; | + Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
92b8bdf474
commit
ade8d71264
@ -124,12 +124,11 @@ pub mod kvm {
|
||||
its_device: &Arc<dyn hypervisor::Device>,
|
||||
save: bool,
|
||||
) -> crate::aarch64::gic::Result<()> {
|
||||
let attr: u64;
|
||||
if save {
|
||||
attr = u64::from(kvm_bindings::KVM_DEV_ARM_ITS_SAVE_TABLES);
|
||||
let attr = if save {
|
||||
u64::from(kvm_bindings::KVM_DEV_ARM_ITS_SAVE_TABLES)
|
||||
} else {
|
||||
attr = u64::from(kvm_bindings::KVM_DEV_ARM_ITS_RESTORE_TABLES);
|
||||
}
|
||||
u64::from(kvm_bindings::KVM_DEV_ARM_ITS_RESTORE_TABLES)
|
||||
};
|
||||
|
||||
let init_gic_attr = kvm_bindings::kvm_device_attr {
|
||||
group: kvm_bindings::KVM_DEV_ARM_VGIC_GRP_CTRL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user