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:
Ruoqing He
2025-09-23 15:07:13 +00:00
committed by cloud-hypervisor-bot
parent ea83fe314c
commit f2dfa7f6e0
56 changed files with 470 additions and 679 deletions
+10 -10
View File
@@ -186,13 +186,13 @@ impl MsixConfig {
table_entry.masked(),
true,
) {
error!("Failed updating vector: {:?}", e);
error!("Failed updating vector: {e:?}");
}
}
} else if old_enabled || !old_masked {
debug!("MSI-X disabled for device 0x{:x}", self.devid);
if let Err(e) = self.interrupt_source_group.disable() {
error!("Failed disabling irq_fd: {:?}", e);
error!("Failed disabling irq_fd: {e:?}");
}
}
}
@@ -235,7 +235,7 @@ impl MsixConfig {
}
};
debug!("MSI_R TABLE offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_R TABLE offset 0x{offset:x} data 0x{value:x}");
LittleEndian::write_u32(data, value);
}
8 => {
@@ -254,7 +254,7 @@ impl MsixConfig {
}
};
debug!("MSI_R TABLE offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_R TABLE offset 0x{offset:x} data 0x{value:x}");
LittleEndian::write_u64(data, value);
}
_ => {
@@ -290,7 +290,7 @@ impl MsixConfig {
_ => error!("invalid offset"),
};
debug!("MSI_W TABLE offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_W TABLE offset 0x{offset:x} data 0x{value:x}");
}
8 => {
let value = LittleEndian::read_u64(data);
@@ -306,7 +306,7 @@ impl MsixConfig {
_ => error!("invalid offset"),
};
debug!("MSI_W TABLE offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_W TABLE offset 0x{offset:x} data 0x{value:x}");
}
_ => error!("invalid data length"),
};
@@ -336,7 +336,7 @@ impl MsixConfig {
table_entry.masked(),
true,
) {
error!("Failed updating vector: {:?}", e);
error!("Failed updating vector: {e:?}");
}
}
@@ -382,7 +382,7 @@ impl MsixConfig {
}
};
debug!("MSI_R PBA offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_R PBA offset 0x{offset:x} data 0x{value:x}");
LittleEndian::write_u32(data, value);
}
8 => {
@@ -394,7 +394,7 @@ impl MsixConfig {
}
};
debug!("MSI_R PBA offset 0x{:x} data 0x{:x}", offset, value);
debug!("MSI_R PBA offset 0x{offset:x} data 0x{value:x}");
LittleEndian::write_u64(data, value);
}
_ => {
@@ -438,7 +438,7 @@ impl MsixConfig {
.trigger(vector as InterruptIndex)
{
Ok(_) => debug!("MSI-X injected on vector control flip"),
Err(e) => error!("failed to inject MSI-X: {}", e),
Err(e) => error!("failed to inject MSI-X: {e}"),
}
// Clear the bit from PBA