mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <robert.bradford@intel.com>
This commit is contained in:
+2
-4
@@ -522,8 +522,6 @@ pub fn create_acpi_tables(
|
|||||||
numa_nodes: &NumaNodes,
|
numa_nodes: &NumaNodes,
|
||||||
) -> GuestAddress {
|
) -> GuestAddress {
|
||||||
let start_time = Instant::now();
|
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 rsdp_offset = arch::layout::RSDP_POINTER;
|
||||||
let mut tables: Vec<u64> = Vec::new();
|
let mut tables: Vec<u64> = Vec::new();
|
||||||
|
|
||||||
@@ -549,8 +547,8 @@ pub fn create_acpi_tables(
|
|||||||
.write_slice(madt.as_slice(), madt_offset)
|
.write_slice(madt.as_slice(), madt_offset)
|
||||||
.expect("Error writing MADT table");
|
.expect("Error writing MADT table");
|
||||||
tables.push(madt_offset.0);
|
tables.push(madt_offset.0);
|
||||||
prev_tbl_len = madt.len() as u64;
|
let mut prev_tbl_len = madt.len() as u64;
|
||||||
prev_tbl_off = madt_offset;
|
let mut prev_tbl_off = madt_offset;
|
||||||
|
|
||||||
// PPTT
|
// PPTT
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
|||||||
Reference in New Issue
Block a user