]> git.proxmox.com Git - qemu.git/commitdiff
qemu/msi: missing braces
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 5 Jul 2009 12:58:52 +0000 (15:58 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 10 Jul 2009 18:44:30 +0000 (13:44 -0500)
MSIX present bit is tested incorrectly, and only happens to work because
the bit we are testing is 0x1.  Add braces to fix this.

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/msix.c

index 47e014017c67e27c83ca1ea564ecb8bdab9a9767..3420ce9b242fda63b1224e0f43ed27ed784fe916 100644 (file)
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -286,8 +286,9 @@ void msix_save(PCIDevice *dev, QEMUFile *f)
 {
     unsigned n = dev->msix_entries_nr;
 
-    if (!dev->cap_present & QEMU_PCI_CAP_MSIX)
+    if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
         return;
+    }
 
     qemu_put_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
     qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);