qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pci: fix compilation warnings


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH] pci: fix compilation warnings
Date: Sun, 10 Apr 2016 11:28:52 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 03/28/2016 10:23 AM, Marcel Apfelbaum wrote:
Fix 'error: shift exponent -1 is negative' warning
by adding a corresponding assert.


Ping.

Thanks,
Marcel

Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
  hw/pci/pci.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e67664d..a1d41aa 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -163,11 +163,15 @@ int pci_bar(PCIDevice *d, int reg)

  static inline int pci_irq_state(PCIDevice *d, int irq_num)
  {
+    assert(irq_num >= 0);
+
        return (d->irq_state >> irq_num) & 0x1;
  }

  static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level)
  {
+    assert(irq_num >= 0);
+
        d->irq_state &= ~(0x1 << irq_num);
        d->irq_state |= level << irq_num;
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]