From patchwork Thu Mar 27 15:28:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 27211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20991202FA for ; Thu, 27 Mar 2014 15:40:08 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf8172665pdj.7 for ; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=4F8f3Z3iDZuSmsfq0DPnIK0aibeWE0jkVSI3u0BIsfE=; b=nCrvOqICdo4NQ002sZskXqxpqU2ed+0rd4wq18gacZfrUhWZ1dV3fjCuiCPRb8a5uX DnbN1kJaUuu9JxDas3AdnTXnpwVZw3PeMZZYAG7txbHvZ4KNi+Js8CKTkVwfPiX7qFsE 8Uq7G8/vDWB6Tnpsabhf72nktchKV8yh0r55RTfYRPLg2XZu6TS+aPZ9M/Pk/Y2LljOb A3Y7XaECwUDa3nGaUIDrQzSZsX5UJ5GvcAq1/OF1ccFf4Qm7xZX3orA6vOruzRo3rKmg 3Krx5MgYFTbfxORxMfQaTVKisfHVcnPCB/JcuP+DCBnQc600wp5SYCPQRhR8SGyjLD1Y Y6uw== X-Gm-Message-State: ALoCoQlKUo/YLiTCL1/oOFQtiYw0IRZnljhi8HzLOHDKTzRcDcjeOMCPiVu/xHeOIEFPIvazhi1A X-Received: by 10.66.66.163 with SMTP id g3mr955556pat.3.1395934808320; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.33 with SMTP id c30ls1221257qge.9.gmail; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) X-Received: by 10.58.111.163 with SMTP id ij3mr1988828veb.26.1395934808125; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id sj4si627006vdc.138.2014.03.27.08.40.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:40:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so4430677veb.0 for ; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr2003474vcb.5.1395934808019; Thu, 27 Mar 2014 08:40:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp38015vck; Thu, 27 Mar 2014 08:40:07 -0700 (PDT) X-Received: by 10.224.30.70 with SMTP id t6mr3042852qac.30.1395934807187; Thu, 27 Mar 2014 08:40:07 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b42si1209390qgd.43.2014.03.27.08.40.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:40:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:54400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCPW-000391-K7 for patch@linaro.org; Thu, 27 Mar 2014 11:40:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCNg-00007x-C3 for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCNX-0006GS-LZ for qemu-devel@nongnu.org; Thu, 27 Mar 2014 11:38:12 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:33599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCNX-0006G5-F5; Thu, 27 Mar 2014 11:38:03 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5318543728; Thu, 27 Mar 2014 19:38:02 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 5B31B687; Thu, 27 Mar 2014 19:28:35 +0400 (MSK) Received: (nullmailer pid 1815 invoked by uid 1000); Thu, 27 Mar 2014 15:28:30 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Thu, 27 Mar 2014 19:28:25 +0400 Message-Id: <1395934108-1694-21-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 20/23] hw/intc/xilinx_intc: Avoid shifting left into sign bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell Avoid undefined behaviour shifting left into the sign bit. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- hw/intc/xilinx_intc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 4a10398..1b228ff 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -71,8 +71,9 @@ static void update_irq(struct xlx_pic *p) /* Update the vector register. */ for (i = 0; i < 32; i++) { - if (p->regs[R_IPR] & (1 << i)) + if (p->regs[R_IPR] & (1U << i)) { break; + } } if (i == 32) i = ~0;