mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Use variables directly in format! string
Fix clippy warning `uninlined_format_args` reported by rustc rustc
1.89.0 (29483883e 2025-08-04).
```console
warning: variables can be used directly in the `format!` string
--> block/src/lib.rs:649:17
|
649 | info!("{} failed to create io_uring instance: {}", error_msg, e);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
|
649 - info!("{} failed to create io_uring instance: {}", error_msg, e);
649 + info!("{error_msg} failed to create io_uring instance: {e}");
|
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
committed by
cloud-hypervisor-bot
parent
ea83fe314c
commit
f2dfa7f6e0
@@ -151,13 +151,13 @@ impl BusDevice for Ioapic {
|
||||
return;
|
||||
}
|
||||
|
||||
debug!("IOAPIC_R @ offset 0x{:x}", offset);
|
||||
debug!("IOAPIC_R @ offset 0x{offset:x}");
|
||||
|
||||
let value: u32 = match offset as u8 {
|
||||
IOREGSEL_OFF => self.reg_sel,
|
||||
IOWIN_OFF => self.ioapic_read(),
|
||||
_ => {
|
||||
error!("IOAPIC: failed reading at offset {}", offset);
|
||||
error!("IOAPIC: failed reading at offset {offset}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
@@ -171,7 +171,7 @@ impl BusDevice for Ioapic {
|
||||
return None;
|
||||
}
|
||||
|
||||
debug!("IOAPIC_W @ offset 0x{:x}", offset);
|
||||
debug!("IOAPIC_W @ offset 0x{offset:x}");
|
||||
|
||||
let value = LittleEndian::read_u32(data);
|
||||
|
||||
@@ -179,7 +179,7 @@ impl BusDevice for Ioapic {
|
||||
IOREGSEL_OFF => self.reg_sel = value,
|
||||
IOWIN_OFF => self.ioapic_write(value),
|
||||
_ => {
|
||||
error!("IOAPIC: failed writing at offset {}", offset);
|
||||
error!("IOAPIC: failed writing at offset {offset}");
|
||||
}
|
||||
}
|
||||
None
|
||||
@@ -266,7 +266,7 @@ impl Ioapic {
|
||||
IOWIN_OFF..=REG_MAX_OFFSET => {
|
||||
let (index, is_high_bits) = decode_irq_from_selector(self.reg_sel as u8);
|
||||
if index > NUM_IOAPIC_PINS {
|
||||
warn!("IOAPIC index out of range: {}", index);
|
||||
warn!("IOAPIC index out of range: {index}");
|
||||
return;
|
||||
}
|
||||
if is_high_bits {
|
||||
@@ -282,7 +282,7 @@ impl Ioapic {
|
||||
// The entry must be updated through the interrupt source
|
||||
// group.
|
||||
if let Err(e) = self.update_entry(index, true) {
|
||||
error!("Failed updating IOAPIC entry: {:?}", e);
|
||||
error!("Failed updating IOAPIC entry: {e:?}");
|
||||
}
|
||||
// Store the information this IRQ is now being used.
|
||||
self.used_entries[index] = true;
|
||||
@@ -303,7 +303,7 @@ impl Ioapic {
|
||||
IOWIN_OFF..=REG_MAX_OFFSET => {
|
||||
let (index, is_high_bits) = decode_irq_from_selector(self.reg_sel as u8);
|
||||
if index > NUM_IOAPIC_PINS {
|
||||
warn!("IOAPIC index out of range: {}", index);
|
||||
warn!("IOAPIC index out of range: {index}");
|
||||
return 0;
|
||||
}
|
||||
if is_high_bits {
|
||||
|
||||
Reference in New Issue
Block a user