From: Michael S. Tsirkin Date: Sun, 5 Jul 2009 12:58:52 +0000 (+0300) Subject: qemu/msi: missing braces X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~11473 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72755a709619b1db204c675df8f1093d54e38128;p=sdk%2Femulator%2Fqemu.git qemu/msi: missing braces 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 Signed-off-by: Michael S. Tsirkin Signed-off-by: Anthony Liguori --- diff --git a/hw/msix.c b/hw/msix.c index 47e0140..3420ce9 100644 --- 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);