From 8fa3864ae8d92efc4f9f34aa2ce1024556391649 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 7 Jan 2022 10:28:40 +0000 Subject: [PATCH] vmm: acpi: Fix clippy (needless_late_init) issue warning: unneeded late initalization --> vmm/src/acpi.rs:525:5 | 525 | let mut prev_tbl_len: u64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::needless_late_init)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `prev_tbl_len` here | 552 | let mut prev_tbl_len: u64 = madt.len() as u64; | ~~~~~~~~~~~~~~~~~~~~~~~~~ warning: unneeded late initalization --> vmm/src/acpi.rs:526:5 | 526 | let mut prev_tbl_off: GuestAddress; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `prev_tbl_off` here | 553 | let mut prev_tbl_off: GuestAddress = madt_offset; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Rob Bradford --- vmm/src/acpi.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vmm/src/acpi.rs b/vmm/src/acpi.rs index 4c82abcdf..12a8c1903 100644 --- a/vmm/src/acpi.rs +++ b/vmm/src/acpi.rs @@ -522,8 +522,6 @@ pub fn create_acpi_tables( numa_nodes: &NumaNodes, ) -> GuestAddress { let start_time = Instant::now(); - let mut prev_tbl_len: u64; - let mut prev_tbl_off: GuestAddress; let rsdp_offset = arch::layout::RSDP_POINTER; let mut tables: Vec = Vec::new(); @@ -549,8 +547,8 @@ pub fn create_acpi_tables( .write_slice(madt.as_slice(), madt_offset) .expect("Error writing MADT table"); tables.push(madt_offset.0); - prev_tbl_len = madt.len() as u64; - prev_tbl_off = madt_offset; + let mut prev_tbl_len = madt.len() as u64; + let mut prev_tbl_off = madt_offset; // PPTT #[cfg(target_arch = "aarch64")]