misc: clippy: add semicolon_if_nothing_returned

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-11-18 12:26:21 +01:00
committed by Rob Bradford
parent ea4f07d3bf
commit b4c62bf159
64 changed files with 244 additions and 236 deletions

View File

@@ -309,7 +309,7 @@ fn create_srat_table(
region,
proximity_domain,
MemAffinityFlags::ENABLE,
))
));
}
for region in &node.hotplug_regions {
@@ -317,7 +317,7 @@ fn create_srat_table(
region,
proximity_domain,
MemAffinityFlags::ENABLE | MemAffinityFlags::HOTPLUGGABLE,
))
));
}
for cpu in &node.cpus {

View File

@@ -1835,11 +1835,11 @@ impl ConsoleConfig {
if parser.is_set("off") {
} else if parser.is_set("pty") {
mode = ConsoleOutputMode::Pty
mode = ConsoleOutputMode::Pty;
} else if parser.is_set("tty") {
mode = ConsoleOutputMode::Tty
mode = ConsoleOutputMode::Tty;
} else if parser.is_set("null") {
mode = ConsoleOutputMode::Null
mode = ConsoleOutputMode::Null;
} else if parser.is_set("file") {
mode = ConsoleOutputMode::File;
file =
@@ -1890,11 +1890,11 @@ impl DebugConsoleConfig {
if parser.is_set("off") {
} else if parser.is_set("pty") {
mode = ConsoleOutputMode::Pty
mode = ConsoleOutputMode::Pty;
} else if parser.is_set("tty") {
mode = ConsoleOutputMode::Tty
mode = ConsoleOutputMode::Tty;
} else if parser.is_set("null") {
mode = ConsoleOutputMode::Null
mode = ConsoleOutputMode::Null;
} else if parser.is_set("file") {
mode = ConsoleOutputMode::File;
file =
@@ -2327,7 +2327,7 @@ impl RestoreConfig {
}
if !restored_net_with_fds.is_empty() {
warn!("Ignoring unused 'net_fds' for VM restore.")
warn!("Ignoring unused 'net_fds' for VM restore.");
}
Ok(())

View File

@@ -739,7 +739,7 @@ impl VcpuState {
fn join_thread(&mut self) -> Result<()> {
if let Some(handle) = self.handle.take() {
handle.join().map_err(Error::ThreadCleanup)?
handle.join().map_err(Error::ThreadCleanup)?;
}
Ok(())
@@ -747,7 +747,7 @@ impl VcpuState {
fn unpark_thread(&self) {
if let Some(handle) = self.handle.as_ref() {
handle.thread().unpark()
handle.thread().unpark();
}
}
}
@@ -823,7 +823,7 @@ impl CpuManager {
let mut cpu_list = Vec::new();
for (proximity_domain, numa_node) in numa_nodes.iter() {
for cpu in numa_node.cpus.iter() {
cpu_list.push((*cpu, *proximity_domain))
cpu_list.push((*cpu, *proximity_domain));
}
}
cpu_list
@@ -1263,7 +1263,7 @@ impl CpuManager {
Ok(details) => match details {
TdxExitDetails::GetQuote => warn!("TDG_VP_VMCALL_GET_QUOTE not supported"),
TdxExitDetails::SetupEventNotifyInterrupt => {
warn!("TDG_VP_VMCALL_SETUP_EVENT_NOTIFY_INTERRUPT not supported")
warn!("TDG_VP_VMCALL_SETUP_EVENT_NOTIFY_INTERRUPT not supported");
}
},
Err(e) => error!("Unexpected TDX VMCALL: {e}"),
@@ -1424,7 +1424,7 @@ impl CpuManager {
cmp::Ordering::Greater => {
let vcpus = self.create_vcpus(desired_vcpus, None)?;
for vcpu in vcpus {
self.configure_vcpu(vcpu, None)?
self.configure_vcpu(vcpu, None)?;
}
self.activate_vcpus(desired_vcpus, true, None)?;
Ok(true)
@@ -2223,7 +2223,7 @@ impl Aml for CpuNotify {
&aml::Equal::new(&aml::Arg(0), &self.cpu_id),
vec![&aml::Notify::new(&object, &aml::Arg(1))],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -2338,9 +2338,9 @@ impl Aml for CpuMethods {
&aml::Release::new("\\_SB_.PRES.CPLK".into()),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
} else {
aml::Method::new("CSCN".into(), 0, true, vec![]).to_aml_bytes(sink)
aml::Method::new("CSCN".into(), 0, true, vec![]).to_aml_bytes(sink);
}
}
}
@@ -2435,7 +2435,7 @@ impl Aml for CpuManager {
cpu_data_inner.push(cpu_device);
}
aml::Device::new("_SB_.CPUS".into(), cpu_data_inner).to_aml_bytes(sink)
aml::Device::new("_SB_.CPUS".into(), cpu_data_inner).to_aml_bytes(sink);
}
}

View File

@@ -688,7 +688,7 @@ impl Console {
pub fn update_console_size(&self) {
if let Some(resizer) = self.console_resizer.as_ref() {
resizer.update_console_size()
resizer.update_console_size();
}
}
}
@@ -1171,7 +1171,7 @@ impl DeviceManager {
if let Some(pci_segments) = &config.lock().unwrap().pci_segments {
for pci_segment in pci_segments.iter() {
mmio32_aperture_weights[pci_segment.pci_segment as usize] =
pci_segment.mmio32_aperture_weight
pci_segment.mmio32_aperture_weight;
}
}
@@ -1191,7 +1191,7 @@ impl DeviceManager {
if let Some(pci_segments) = &config.lock().unwrap().pci_segments {
for pci_segment in pci_segments.iter() {
mmio64_aperture_weights[pci_segment.pci_segment as usize] =
pci_segment.mmio64_aperture_weight
pci_segment.mmio64_aperture_weight;
}
}
@@ -1460,7 +1460,7 @@ impl DeviceManager {
if let Some(tpm) = self.config.clone().lock().unwrap().tpm.as_ref() {
let tpm_dev = self.add_tpm_device(tpm.socket.clone())?;
self.bus_devices
.push(Arc::clone(&tpm_dev) as Arc<dyn BusDeviceSync>)
.push(Arc::clone(&tpm_dev) as Arc<dyn BusDeviceSync>);
}
self.legacy_interrupt_manager = Some(legacy_interrupt_manager);
@@ -4606,7 +4606,7 @@ impl DeviceManager {
self.mmio_regions
.lock()
.unwrap()
.retain(|x| x.start != mmio_region.start)
.retain(|x| x.start != mmio_region.start);
}
(
@@ -5078,7 +5078,7 @@ impl Aml for TpmDevice {
),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -5098,7 +5098,7 @@ impl Aml for DeviceManager {
}
let mut pci_scan_inner: Vec<&dyn Aml> = Vec::new();
for method in &pci_scan_methods {
pci_scan_inner.push(method)
pci_scan_inner.push(method);
}
// PCI hotplug controller
@@ -5171,7 +5171,7 @@ impl Aml for DeviceManager {
true,
segment.mmio_config_address as u32,
layout::PCI_MMIO_CONFIG_SIZE_PER_SEGMENT as u32,
))
));
}
let mut mbrd_memory_refs = Vec::new();
@@ -5281,7 +5281,7 @@ impl Aml for DeviceManager {
.unwrap()
.lock()
.unwrap()
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -5432,7 +5432,7 @@ impl BusDevice for DeviceManager {
_ => error!("Accessing unknown location at base 0x{base:x}, offset 0x{offset:x}"),
}
debug!("PCI_HP_REG_R: base 0x{base:x}, offset 0x{offset:x}, data {data:?}")
debug!("PCI_HP_REG_R: base 0x{base:x}, offset 0x{offset:x}, data {data:?}");
}
fn write(&mut self, base: u64, offset: u64, data: &[u8]) -> Option<Arc<std::sync::Barrier>> {

View File

@@ -1466,7 +1466,7 @@ impl Vmm {
// Wait for all the threads to finish
for thread in self.threads.drain(..) {
thread.join().map_err(Error::ThreadCleanup)?
thread.join().map_err(Error::ThreadCleanup)?;
}
Ok(())
@@ -2214,7 +2214,7 @@ impl RequestHandler for Vmm {
})?;
if existing_memory_files.is_none() {
existing_memory_files = Some(HashMap::default())
existing_memory_files = Some(HashMap::default());
}
if let Some(ref mut existing_memory_files) = existing_memory_files {

View File

@@ -2131,7 +2131,7 @@ impl Aml for MemoryNotify {
&aml::Equal::new(&aml::Arg(0), &self.slot_id),
vec![&aml::Notify::new(&object, &aml::Arg(1))],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -2178,7 +2178,7 @@ impl Aml for MemorySlot {
),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -2361,7 +2361,7 @@ impl Aml for MemoryMethods {
&aml::Return::new(&aml::Path::new("MR64")),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}

View File

@@ -227,7 +227,7 @@ impl Aml for PciDevSlot {
),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -281,7 +281,7 @@ impl Aml for PciDevSlotMethods {
&aml::Release::new("\\_SB_.PHPR.BLCK".into()),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -344,7 +344,7 @@ impl Aml for PciDsmMethod {
&aml::Return::new(&aml::BufferData::new(vec![0])),
],
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}
@@ -470,6 +470,6 @@ impl Aml for PciSegment {
format!("_SB_.PC{:02X}", self.id).as_str().into(),
pci_dsdt_inner_data,
)
.to_aml_bytes(sink)
.to_aml_bytes(sink);
}
}

View File

@@ -1627,7 +1627,7 @@ impl Vm {
// Wait for all the threads to finish
for thread in self.threads.drain(..) {
thread.join().map_err(Error::ThreadCleanup)?
thread.join().map_err(Error::ThreadCleanup)?;
}
*state = new_state;
@@ -2350,7 +2350,7 @@ impl Vm {
&self.memory_manager,
&self.numa_nodes,
tpm_enabled,
)?
)?;
}
}
}