From da353a0dbf39a8b2087239d21325c167c622f9d1 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 9 Jul 2024 14:55:15 -0700 Subject: [PATCH] devices: pci: remove unreachable 64-bit BAR check end_addr is a u64, so its value cannot be greater than the max u64 value. The compiler doesn't warn about this when using the legacy u64::max_value() function, but it becomes a warning when this is replaced with the u64::MAX constant. BUG=None TEST=tools/dev_container tools/presumbit Change-Id: I05ed36027718d62782ea2f2c597fe391fe9f0fae Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5690373 Reviewed-by: Dennis Kempin Commit-Queue: Daniel Verkamp --- devices/src/pci/pci_configuration.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/devices/src/pci/pci_configuration.rs b/devices/src/pci/pci_configuration.rs index 92b3a3de86..ea9192a8ab 100644 --- a/devices/src/pci/pci_configuration.rs +++ b/devices/src/pci/pci_configuration.rs @@ -714,10 +714,6 @@ impl PciConfiguration { return Err(Error::BarInvalid64(config.bar_idx)); } - if end_addr > u64::max_value() { - return Err(Error::BarAddressInvalid(config.addr, config.size)); - } - if self.bar_used[config.bar_idx + 1] { return Err(Error::BarInUse64(config.bar_idx)); }