block, pci, rate_limiter, vm-allocator: drop legacy numeric constants

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2024-04-29 03:47:15 +00:00
committed by Rob Bradford
parent 0816c8292f
commit f6cd3bd86d
7 changed files with 12 additions and 16 deletions

View File

@@ -409,7 +409,7 @@ impl BusDevice for PciConfigMmio {
// Only allow reads to the register boundary.
let start = offset as usize % 4;
let end = start + data.len();
if end > 4 || offset > u64::from(u32::max_value()) {
if end > 4 || offset > u64::from(u32::MAX) {
for d in data {
*d = 0xff;
}
@@ -423,7 +423,7 @@ impl BusDevice for PciConfigMmio {
}
fn write(&mut self, _base: u64, offset: u64, data: &[u8]) -> Option<Arc<Barrier>> {
if offset > u64::from(u32::max_value()) {
if offset > u64::from(u32::MAX) {
return None;
}
self.config_space_write(offset as u32, offset % 4, data);