Re: [kvm-unit-tests PATCH v3 2/6] pci: cast the masks to the appropriate size

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

 



On 30/10/2019 22.04, Bill Wendling wrote:
At this point, we're dealing with 32-bit addresses, therefore downcast
the masks to 32-bits.

In case you respin, please mention the warning from clang that you are fixing here.

diff --git a/lib/pci.c b/lib/pci.c
index daa33e1..1b85411 100644
--- a/lib/pci.c
+++ b/lib/pci.c
@@ -107,7 +107,8 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id)
  uint32_t pci_bar_mask(uint32_t bar)
  {
  	return (bar & PCI_BASE_ADDRESS_SPACE_IO) ?
-		PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK;
+		(uint32_t)PCI_BASE_ADDRESS_IO_MASK :
+		(uint32_t)PCI_BASE_ADDRESS_MEM_MASK;
  }
uint32_t pci_bar_get(struct pci_dev *dev, int bar_num)

Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>





[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