From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apAju-0000PY-TE for qemu-devel@nongnu.org; Sun, 10 Apr 2016 04:29:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apAjr-0002s1-N5 for qemu-devel@nongnu.org; Sun, 10 Apr 2016 04:29:02 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apAjr-0002ru-Dg for qemu-devel@nongnu.org; Sun, 10 Apr 2016 04:28:59 -0400 Received: by mail-wm0-x243.google.com with SMTP id y144so14272810wmd.0 for ; Sun, 10 Apr 2016 01:28:59 -0700 (PDT) Reply-To: marcel@redhat.com References: <1459149797-24108-1-git-send-email-marcel@redhat.com> From: Marcel Apfelbaum Message-ID: <570A0EC4.6010700@gmail.com> Date: Sun, 10 Apr 2016 11:28:52 +0300 MIME-Version: 1.0 In-Reply-To: <1459149797-24108-1-git-send-email-marcel@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci: fix compilation warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, armbru@redhat.com, mst@redhat.com 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 > Signed-off-by: Markus Armbruster > Signed-off-by: Marcel Apfelbaum > --- > 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; > } >