mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
ea4f07d3bf
commit
b4c62bf159
@@ -546,7 +546,7 @@ impl VirtioDevice for Balloon {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
|
||||
@@ -522,7 +522,7 @@ impl BlockEpollHandler {
|
||||
"Failed scheduling the virtqueue thread {} on the expected CPU set: {}",
|
||||
self.queue_index,
|
||||
io::Error::last_os_error()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -562,7 +562,7 @@ impl EpollHelperHandler for BlockEpollHandler {
|
||||
|
||||
// Process the queue only when the rate limit is not reached
|
||||
if !rate_limit_reached {
|
||||
self.process_queue_submit_and_signal()?
|
||||
self.process_queue_submit_and_signal()?;
|
||||
}
|
||||
}
|
||||
COMPLETION_EVENT => {
|
||||
@@ -598,7 +598,7 @@ impl EpollHelperHandler for BlockEpollHandler {
|
||||
))
|
||||
})?;
|
||||
|
||||
self.process_queue_submit_and_signal()?
|
||||
self.process_queue_submit_and_signal()?;
|
||||
} else {
|
||||
return Err(EpollHelperError::HandleEvent(anyhow!(
|
||||
"Unexpected 'RATE_LIMITER_EVENT' when rate_limiter is not enabled."
|
||||
@@ -874,7 +874,7 @@ impl VirtioDevice for Block {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -1027,7 +1027,7 @@ impl VirtioDevice for Block {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ impl VirtioDevice for Console {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -766,7 +766,7 @@ impl VirtioDevice for Console {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1048,7 +1048,7 @@ impl VirtioDevice for Iommu {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
|
||||
@@ -901,7 +901,7 @@ impl VirtioDevice for Mem {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
|
||||
@@ -684,7 +684,7 @@ impl VirtioDevice for Net {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -852,7 +852,7 @@ impl VirtioDevice for Net {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -374,7 +374,7 @@ impl VirtioDevice for Pmem {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -440,7 +440,7 @@ impl VirtioDevice for Pmem {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ impl VirtioDevice for Rng {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn activate(
|
||||
@@ -297,7 +297,7 @@ impl VirtioDevice for Rng {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,12 @@ impl VirtioPciCommonConfig {
|
||||
1 => self.write_common_config_byte(offset, data[0]),
|
||||
2 => self.write_common_config_word(offset, LittleEndian::read_u16(data), queues),
|
||||
4 => {
|
||||
self.write_common_config_dword(offset, LittleEndian::read_u32(data), queues, device)
|
||||
self.write_common_config_dword(
|
||||
offset,
|
||||
LittleEndian::read_u32(data),
|
||||
queues,
|
||||
device,
|
||||
);
|
||||
}
|
||||
8 => self.write_common_config_qword(offset, LittleEndian::read_u64(data), queues),
|
||||
_ => error!("invalid data length for virtio write: len {}", data.len()),
|
||||
|
||||
@@ -395,7 +395,7 @@ impl VirtioPciDevice {
|
||||
for _ in locked_device.queue_max_sizes().iter() {
|
||||
queue_evts.push(EventFd::new(EFD_NONBLOCK).map_err(|e| {
|
||||
VirtioPciDeviceError::CreateVirtioPciDevice(anyhow!("Failed creating eventfd: {e}"))
|
||||
})?)
|
||||
})?);
|
||||
}
|
||||
let num_queues = locked_device.queue_max_sizes().len();
|
||||
|
||||
@@ -748,7 +748,7 @@ impl VirtioPciDevice {
|
||||
let bar_offset: u32 =
|
||||
// SAFETY: we know self.cap_pci_cfg_info.cap.cap.offset is 32bits long.
|
||||
unsafe { std::mem::transmute(self.cap_pci_cfg_info.cap.cap.offset) };
|
||||
self.read_bar(0, bar_offset as u64, data)
|
||||
self.read_bar(0, bar_offset as u64, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1240,7 +1240,7 @@ impl PciDevice for VirtioPciDevice {
|
||||
|
||||
impl BusDevice for VirtioPciDevice {
|
||||
fn read(&mut self, base: u64, offset: u64, data: &mut [u8]) {
|
||||
self.read_bar(base, offset, data)
|
||||
self.read_bar(base, offset, data);
|
||||
}
|
||||
|
||||
fn write(&mut self, base: u64, offset: u64, data: &[u8]) -> Option<Arc<Barrier>> {
|
||||
|
||||
@@ -398,7 +398,7 @@ impl VirtioDevice for Vdpa {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -444,7 +444,7 @@ impl VirtioDevice for Vdpa {
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ impl VirtioDevice for Blk {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -346,7 +346,7 @@ impl VirtioDevice for Blk {
|
||||
}
|
||||
|
||||
fn shutdown(&mut self) {
|
||||
self.vu_common.shutdown()
|
||||
self.vu_common.shutdown();
|
||||
}
|
||||
|
||||
fn add_memory_region(
|
||||
|
||||
@@ -252,7 +252,7 @@ impl VirtioDevice for Fs {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -326,7 +326,7 @@ impl VirtioDevice for Fs {
|
||||
}
|
||||
|
||||
fn shutdown(&mut self) {
|
||||
self.vu_common.shutdown()
|
||||
self.vu_common.shutdown();
|
||||
}
|
||||
|
||||
fn get_shm_regions(&self) -> Option<VirtioSharedMemoryList> {
|
||||
@@ -361,7 +361,7 @@ impl VirtioDevice for Fs {
|
||||
addr: cache.0.addr,
|
||||
len: cache.0.len,
|
||||
mergeable: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
mappings
|
||||
|
||||
@@ -282,7 +282,7 @@ impl VirtioDevice for Net {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
|
||||
@@ -406,7 +406,7 @@ where
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn read_config(&self, offset: u64, data: &mut [u8]) {
|
||||
@@ -414,7 +414,7 @@ where
|
||||
0 if data.len() == 8 => LittleEndian::write_u64(data, self.cid),
|
||||
0 if data.len() == 4 => LittleEndian::write_u32(data, (self.cid & 0xffff_ffff) as u32),
|
||||
4 if data.len() == 4 => {
|
||||
LittleEndian::write_u32(data, ((self.cid >> 32) & 0xffff_ffff) as u32)
|
||||
LittleEndian::write_u32(data, ((self.cid >> 32) & 0xffff_ffff) as u32);
|
||||
}
|
||||
_ => warn!(
|
||||
"vsock: virtio-vsock received invalid read request of {} bytes at offset {}",
|
||||
@@ -481,7 +481,7 @@ where
|
||||
}
|
||||
|
||||
fn set_access_platform(&mut self, access_platform: Arc<dyn AccessPlatform>) {
|
||||
self.common.set_access_platform(access_platform)
|
||||
self.common.set_access_platform(access_platform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ impl VsockMuxer {
|
||||
})
|
||||
.unwrap_or_else(|err| {
|
||||
info!("vsock: error adding local-init connection: {err:?}");
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ impl VirtioDevice for Watchdog {
|
||||
}
|
||||
|
||||
fn ack_features(&mut self, value: u64) {
|
||||
self.common.ack_features(value)
|
||||
self.common.ack_features(value);
|
||||
}
|
||||
|
||||
fn activate(
|
||||
|
||||
Reference in New Issue
Block a user