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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Reviewed-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>
---
 vfio/pci.c | 5 -----
 1 file changed, 5 deletions(-)

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;
 
-- 
2.17.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux