diff mbox series

[kvmtool,2/4] vfio: remove unneeded test

Message ID 20190503171544.260901-3-andre.przywara@arm.com (mailing list archive)
State New, archived
Headers show
Series kvmtool: clang/GCC9 fixes | expand

Commit Message

Andre Przywara May 3, 2019, 5:15 p.m. UTC
clang complained that the comparison of an u8 variable against 256 is
somewhat pointless.

Just remove the check, as the condition will never hit.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
---
 vfio/pci.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/vfio/pci.c b/vfio/pci.c
index 10aa87b1..a4086326 100644
--- a/vfio/pci.c
+++ b/vfio/pci.c
@@ -557,11 +557,6 @@  static int vfio_pci_parse_caps(struct vfio_device *vdev)
 	pdev->hdr.capabilities = 0;
 
 	for (; pos; pos = next) {
-		if (pos >= PCI_DEV_CFG_SIZE) {
-			vfio_dev_warn(vdev, "ignoring cap outside of config space");
-			return -EINVAL;
-		}
-
 		cap = PCI_CAP(&pdev->hdr, pos);
 		next = cap->next;