Received: from eggs.gnu.org ([2001:4830:134:3::10]:55873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZy3-0005EL-I2 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 12:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPZy1-0007hU-9U for qemu-devel@nongnu.org; Mon, 17 Mar 2014 12:00:47 -0400 From: Peter Maydell Date: Mon, 17 Mar 2014 16:00:39 +0000 Message-Id: <1395072041-18911-11-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> References: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 10/12] hw/intc/slavio_intctl: Avoid shifting left into sign bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, patches@linaro.org Add 'U' suffix to avoid undefined behaviour. Signed-off-by: Peter Maydell --- hw/intc/slavio_intctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index 41a1672..b10fb66 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -272,7 +272,7 @@ static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs) CPU_IRQ_TIMER_IN; if (i == s->target_cpu) { for (j = 0; j < 32; j++) { - if ((s->intregm_pending & (1 << j)) && intbit_to_level[j]) { + if ((s->intregm_pending & (1U << j)) && intbit_to_level[j]) { s->slaves[i].intreg_pending |= 1 << intbit_to_level[j]; } } -- 1.9.0