misc: clippy: add unnecessary_semicolon
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
parent
06390342a6
commit
7cb73e9e56
36 changed files with 72 additions and 73 deletions
|
|
@ -172,6 +172,7 @@ suspicious = "deny"
|
|||
# Individual Lints
|
||||
assertions_on_result_states = "deny"
|
||||
undocumented_unsafe_blocks = "deny"
|
||||
unnecessary_semicolon = "deny"
|
||||
|
||||
[workspace.lints.rust]
|
||||
# `level = warn` is irrelevant here but mandatory for rustc/cargo
|
||||
|
|
|
|||
|
|
@ -1150,7 +1150,7 @@ fn print_node(node: fdt_parser::node::FdtNode<'_, '_>, n_spaces: usize) {
|
|||
array,
|
||||
indent = (n_spaces + 2)
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Print children nodes if there is any
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ fn print_node(node: fdt_parser::node::FdtNode<'_, '_>, n_spaces: usize) {
|
|||
array,
|
||||
indent = (n_spaces + 2)
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Print children nodes if there is any
|
||||
|
|
|
|||
|
|
@ -824,7 +824,7 @@ pub fn configure_vcpu(
|
|||
* APIC_BUS_CYCLE_NS */
|
||||
..Default::default()
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
for c in &cpuid {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ pub fn setup_regs(vcpu: &dyn hypervisor::Vcpu, entry_point: EntryPoint) -> Resul
|
|||
regs.set_rsp(BOOT_STACK_POINTER.raw_value());
|
||||
regs.set_rsi(ZERO_PAGE_START.raw_value());
|
||||
}
|
||||
};
|
||||
}
|
||||
vcpu.set_regs(®s).map_err(Error::SetBaseRegisters)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ impl Request {
|
|||
.map_err(ExecuteError::Write)?;
|
||||
}
|
||||
RequestType::Unsupported(t) => return Err(ExecuteError::Unsupported(t)),
|
||||
};
|
||||
}
|
||||
}
|
||||
Ok(len)
|
||||
}
|
||||
|
|
@ -901,7 +901,7 @@ impl DiskTopology {
|
|||
};
|
||||
if ret != 0 {
|
||||
return Err(std::io::Error::last_os_error());
|
||||
};
|
||||
}
|
||||
|
||||
Ok(block_size)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ impl Write for RawFile {
|
|||
// SAFETY: tmp_ptr was allocated by alloc_zeroed with layout
|
||||
unsafe { dealloc(tmp_ptr, layout) };
|
||||
return Err(io::Error::last_os_error());
|
||||
};
|
||||
}
|
||||
|
||||
tmp_buf[file_offset..(file_offset + buf_len)].copy_from_slice(buf);
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ pub fn read(
|
|||
_ => {
|
||||
return Err(VhdxIoError::InvalidBatEntryState);
|
||||
}
|
||||
};
|
||||
}
|
||||
sector_count -= sector.free_sectors;
|
||||
sector_index += sector.free_sectors;
|
||||
read_count += sector.free_bytes as usize;
|
||||
|
|
@ -210,7 +210,7 @@ pub fn write(
|
|||
_ => {
|
||||
return Err(VhdxIoError::InvalidBatEntryState);
|
||||
}
|
||||
};
|
||||
}
|
||||
sector_count -= sector.free_sectors;
|
||||
sector_index += sector.free_sectors;
|
||||
write_count += sector.free_bytes as usize;
|
||||
|
|
|
|||
|
|
@ -233,20 +233,18 @@ impl PciDevice for IvshmemDevice {
|
|||
if let Some(resources) = resources {
|
||||
for resource in resources {
|
||||
match resource {
|
||||
Resource::PciBar { index, base, .. } => {
|
||||
match index {
|
||||
IVSHMEM_BAR0_IDX => {
|
||||
bar0_addr = Some(GuestAddress(base));
|
||||
}
|
||||
IVSHMEM_BAR1_IDX => {}
|
||||
IVSHMEM_BAR2_IDX => {
|
||||
bar2_addr = Some(GuestAddress(base));
|
||||
}
|
||||
_ => {
|
||||
error!("Unexpected pci bar index {index}");
|
||||
}
|
||||
};
|
||||
}
|
||||
Resource::PciBar { index, base, .. } => match index {
|
||||
IVSHMEM_BAR0_IDX => {
|
||||
bar0_addr = Some(GuestAddress(base));
|
||||
}
|
||||
IVSHMEM_BAR1_IDX => {}
|
||||
IVSHMEM_BAR2_IDX => {
|
||||
bar2_addr = Some(GuestAddress(base));
|
||||
}
|
||||
_ => {
|
||||
error!("Unexpected pci bar index {index}");
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
error!("Unexpected resource {resource:?}");
|
||||
}
|
||||
|
|
@ -348,7 +346,7 @@ impl PciDevice for IvshmemDevice {
|
|||
_ => {
|
||||
warn!("Invalid bar_idx: {bar_idx}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn write_bar(&mut self, base: u64, offset: u64, _data: &[u8]) -> Option<Arc<Barrier>> {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ impl BusDevice for Cmos {
|
|||
}
|
||||
}
|
||||
o => warn!("bad write offset on CMOS device: {o}"),
|
||||
};
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -710,7 +710,7 @@ impl FwCfg {
|
|||
let bytes = n.to_le_bytes();
|
||||
data.copy_from_slice(&bytes[start..end]);
|
||||
}
|
||||
};
|
||||
}
|
||||
Some(size as u8)
|
||||
}
|
||||
|
||||
|
|
@ -756,7 +756,7 @@ impl BusDevice for FwCfg {
|
|||
"fw_cfg: read from unknown port {port:#x}: {size:#x} bytes and offset {offset:#x}."
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn write(&mut self, _base: u64, offset: u64, data: &[u8]) -> Option<Arc<Barrier>> {
|
||||
|
|
@ -792,7 +792,7 @@ impl BusDevice for FwCfg {
|
|||
_ => debug!(
|
||||
"fw_cfg: write to unknown port {port:#x}: {size:#x} bytes and offset {offset:#x} ."
|
||||
),
|
||||
};
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ fn set_op<T: CpuStateManager>(
|
|||
platform.write_memory(addr, &value.to_le_bytes()[..op_size])?;
|
||||
}
|
||||
k => return Err(PlatformError::InvalidOperand(anyhow!("{:?}", k))),
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ impl Tap {
|
|||
&ifreq,
|
||||
)?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ fn split_commas(s: &str) -> OptionParserResult<Vec<String>> {
|
|||
continue;
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
current.push(c);
|
||||
}
|
||||
list.push(current);
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ impl PciConfiguration {
|
|||
writable_bits[9] = 0xfff0_fff0; // Memory base and limit
|
||||
writable_bits[15] = 0xffff_00ff; // Bridge control (r/w), interrupt line (r/w)
|
||||
}
|
||||
};
|
||||
}
|
||||
registers[11] = (u32::from(subsystem_id) << 16) | u32::from(subsystem_vendor_id);
|
||||
|
||||
(
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ impl MsixConfig {
|
|||
self.table_entries[index].vector_ctl = value;
|
||||
}
|
||||
_ => error!("invalid offset"),
|
||||
};
|
||||
}
|
||||
|
||||
debug!("MSI_W TABLE offset 0x{offset:x} data 0x{value:x}");
|
||||
}
|
||||
|
|
@ -304,12 +304,12 @@ impl MsixConfig {
|
|||
self.table_entries[index].vector_ctl = (value >> 32) as u32;
|
||||
}
|
||||
_ => error!("invalid offset"),
|
||||
};
|
||||
}
|
||||
|
||||
debug!("MSI_W TABLE offset 0x{offset:x} data 0x{value:x}");
|
||||
}
|
||||
_ => error!("invalid data length"),
|
||||
};
|
||||
}
|
||||
|
||||
let table_entry = &self.table_entries[index];
|
||||
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ impl VfioCommon {
|
|||
PCI_CONFIG_BAR_PREFETCHABLE
|
||||
) {
|
||||
prefetchable = PciBarPrefetchable::Prefetchable
|
||||
};
|
||||
}
|
||||
|
||||
// To get size write all 1s
|
||||
self.vfio_wrapper
|
||||
|
|
@ -941,7 +941,7 @@ impl VfioCommon {
|
|||
PciCapabilityId::PciExpress => pci_express_cap_found = true,
|
||||
PciCapabilityId::PowerManagement => power_management_cap_found = true,
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
|
||||
let cap_next = self.vfio_wrapper.read_config_byte((cap_iter + 1).into())
|
||||
& PCI_CONFIG_CAPABILITY_PTR_MASK;
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ fn main() {
|
|||
eprintln!("Aborting test due to error: '{e:?}'");
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ impl RateLimiterGroup {
|
|||
error!("rate-limit-group worker panicked");
|
||||
exit_evt.write(1).unwrap();
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
.map(|thread| self.epoll_thread.insert(thread))
|
||||
.map_err(Error::ThreadSpawn)?;
|
||||
|
|
|
|||
|
|
@ -491,12 +491,12 @@ impl RateLimiter {
|
|||
BucketUpdate::Disabled => guard.bandwidth = None,
|
||||
BucketUpdate::Update(tb) => guard.bandwidth = Some(tb),
|
||||
BucketUpdate::None => (),
|
||||
};
|
||||
}
|
||||
match ops {
|
||||
BucketUpdate::Disabled => guard.ops = None,
|
||||
BucketUpdate::Update(tb) => guard.ops = Some(tb),
|
||||
BucketUpdate::None => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1201,7 +1201,7 @@ fn main() {
|
|||
server_api_error_display_modifier,
|
||||
);
|
||||
process::exit(1)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@ fn scp_to_guest_with_auth(
|
|||
return Err(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
thread::sleep(std::time::Duration::new((timeout * counter).into(), 0));
|
||||
}
|
||||
Ok(())
|
||||
|
|
@ -730,7 +730,7 @@ pub fn ssh_command_ip_with_auth(
|
|||
return Err(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
thread::sleep(std::time::Duration::new((timeout * counter).into(), 0));
|
||||
}
|
||||
Ok(s)
|
||||
|
|
@ -1334,7 +1334,7 @@ impl<'a> GuestCommand<'a> {
|
|||
Debug => {
|
||||
self.command.args(["-vv"]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if self.print_cmd {
|
||||
println!(
|
||||
|
|
|
|||
|
|
@ -7683,7 +7683,7 @@ mod ivshmem {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10098,7 +10098,7 @@ mod live_migration {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10272,7 +10272,7 @@ mod live_migration {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10490,7 +10490,7 @@ mod live_migration {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10706,7 +10706,7 @@ mod live_migration {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10816,7 +10816,7 @@ mod live_migration {
|
|||
Some(ovs_child),
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functional
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -10963,7 +10963,7 @@ mod live_migration {
|
|||
None,
|
||||
"source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// Post live-migration check to make sure the destination VM is functioning
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
@ -11177,7 +11177,7 @@ mod live_migration {
|
|||
None,
|
||||
"Source VM was not terminated successfully.",
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// After live migration, ensure the destination VM is running normally
|
||||
let r = std::panic::catch_unwind(|| {
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ impl BlockEpollHandler {
|
|||
queue.go_to_previous_position();
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
request.set_writeback(self.writeback.load(Ordering::Acquire));
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ impl EpollHelperHandler for NetCtrlEpollHandler {
|
|||
"Error getting notification state of control queue: {e}"
|
||||
)));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
return Err(EpollHelperError::HandleEvent(anyhow!(
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ where
|
|||
thread_exit_evt.write(1).ok();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
.map(|thread| epoll_threads.push(thread))
|
||||
.map_err(|e| {
|
||||
|
|
|
|||
|
|
@ -1192,7 +1192,7 @@ impl PciDevice for VirtioPciDevice {
|
|||
}
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
||||
// Try and activate the device if the driver status has changed
|
||||
if self.needs_activation() {
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ where
|
|||
self.last_fwd_cnt_to_peer = self.fwd_cnt;
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// A credit update is basically a no-op, so we should only waste a perfectly fine RX
|
||||
|
|
@ -380,7 +380,7 @@ where
|
|||
pkt.hdr()
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -459,7 +459,7 @@ where
|
|||
// it does, so let's absorb it.
|
||||
}
|
||||
_ => self.kill(),
|
||||
};
|
||||
}
|
||||
0
|
||||
});
|
||||
self.fwd_cnt += Wrapping(flushed as u32);
|
||||
|
|
|
|||
|
|
@ -753,7 +753,7 @@ impl VsockMuxer {
|
|||
conn.kill();
|
||||
warn!("vsock: unable to ack host connection: {err:?}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// If the connection wasn't previously scheduled for RX, add it to our RX queue.
|
||||
|
|
@ -975,7 +975,7 @@ mod unit_tests {
|
|||
EpollListener::LocalStream(_) => local_lsn_count += 1,
|
||||
EpollListener::Connection { .. } => conn_lsn_count += 1,
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
(local_lsn_count, conn_lsn_count)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ impl MuxerRxQ {
|
|||
MuxerRx::ConnRx(_) => {
|
||||
self.synced = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ fn create_acpi_tables_internal(
|
|||
|
||||
prev_tbl_len = slit.len() as u64;
|
||||
prev_tbl_addr = slit_addr;
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
{
|
||||
|
|
@ -957,7 +957,7 @@ pub fn create_acpi_tables_tdx(
|
|||
|
||||
// SLIT
|
||||
tables.push(create_slit_table(numa_nodes));
|
||||
};
|
||||
}
|
||||
|
||||
// VIOT
|
||||
if let Some((iommu_bdf, devices_bdf)) = device_manager.lock().unwrap().iommu_attached_devices()
|
||||
|
|
|
|||
|
|
@ -2514,10 +2514,10 @@ impl VmConfig {
|
|||
let mut tty_consoles = Vec::new();
|
||||
if self.console.mode == ConsoleOutputMode::Tty {
|
||||
tty_consoles.push("virtio-console");
|
||||
};
|
||||
}
|
||||
if self.serial.mode == ConsoleOutputMode::Tty {
|
||||
tty_consoles.push("serial-console");
|
||||
};
|
||||
}
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
if self.debug_console.mode == ConsoleOutputMode::Tty {
|
||||
tty_consoles.push("debug-console");
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ impl TryFrom<&str> for LandlockAccess {
|
|||
format!("Invalid access: {c}").to_string(),
|
||||
));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Ok(LandlockAccess { access })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ impl Vmm {
|
|||
error!("Error creating Landlock object: {e:?}");
|
||||
exit_evt.write(1).ok();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
std::panic::catch_unwind(AssertUnwindSafe(|| {
|
||||
|
|
@ -1513,7 +1513,7 @@ impl RequestHandler for Vmm {
|
|||
// If we don't have a config, we cannot boot a VM.
|
||||
if self.vm_config.is_none() {
|
||||
return Err(VmError::VmMissingConfig);
|
||||
};
|
||||
}
|
||||
|
||||
// console_info is set to None in vm_shutdown. re-populate here if empty
|
||||
if self.console_info.is_none() {
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ impl BusDevice for MemoryManager {
|
|||
_ => {
|
||||
warn!("Unexpected offset for accessing memory manager device: {offset:#}");
|
||||
}
|
||||
};
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ impl VmOps for VmOpsHandler {
|
|||
info!("Barrier released");
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +488,7 @@ impl VmOps for VmOpsHandler {
|
|||
info!("Barrier released");
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue