From patchwork Thu Mar 27 15:28:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 27226 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3E832057C for ; Thu, 27 Mar 2014 16:09:19 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lg15sf8233227vcb.11 for ; Thu, 27 Mar 2014 09:09:19 -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=CN4ZbJK/AFJ2njKgZUrNLnEXyT+vEa7dSGeX5MEW3zw=; b=O5ZlnkE7GkN6WIHktKe5WNHDN04hJKz5MIyVFEXiQTwI4QqyAkUQqcD40xvzX51p8S rmeIfl67U4ZxoJRC5Xcq4Tg3lb48QfgTStgmHgPYbWnCGU6zOJgozgxufRXt6a2nLbmk vy7R6bRriginBXLc1LlzKjtd/R7Sp1sc2wqrBUeC3TpExuUG69IFkbiiQru3Am880K6U Win/7EHjFXsrEDi9f1s/S0+RXvhb1l3StlS0tucUm3HUaWGSPZkXwuX8sX9uvodXJlsD N064UjnUqBDuDzUDU2gQIH5ygyAEY1vR3KzqoNop1RjNGc7AIqPp/7EYVsvcQWaEgrvL zhdA== X-Gm-Message-State: ALoCoQnRgT5uS04ovQCU/2P4h9SL8ZPfhMB/h1G2BJkI2gbffWWHiWOkP6Cj031SYhIZN3SPSwCg X-Received: by 10.58.210.2 with SMTP id mq2mr22992206vec.3.1395936559531; Thu, 27 Mar 2014 09:09:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.169 with SMTP id z38ls1133297qgz.36.gmail; Thu, 27 Mar 2014 09:09:19 -0700 (PDT) X-Received: by 10.220.83.4 with SMTP id d4mr11938vcl.39.1395936559397; Thu, 27 Mar 2014 09:09:19 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id sj10si662093vcb.15.2014.03.27.09.09.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:09:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so4429067vcb.18 for ; Thu, 27 Mar 2014 09:09:19 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr2165694vcb.22.1395936559309; Thu, 27 Mar 2014 09:09:19 -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 i9csp40397vck; Thu, 27 Mar 2014 09:09:19 -0700 (PDT) X-Received: by 10.229.198.2 with SMTP id em2mr3062937qcb.21.1395936558736; Thu, 27 Mar 2014 09:09:18 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s10si1233866qak.152.2014.03.27.09.09.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:09:18 -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]:54694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCrm-0006vd-4e for patch@linaro.org; Thu, 27 Mar 2014 12:09:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqg-0005lQ-Ty for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCqa-0000vT-O5 for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:10 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:54027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqa-0000vC-Gg; Thu, 27 Mar 2014 12:08:04 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B6D0E43735; Thu, 27 Mar 2014 20:08: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 40A9A685; Thu, 27 Mar 2014 19:28:35 +0400 (MSK) Received: (nullmailer pid 1799 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:21 +0400 Message-Id: <1395934108-1694-17-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 16/23] hw/intc/openpic: 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.220.173 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 Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1 << 31 cases; for consistency we extend it to other constants in the same group. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- hw/intc/openpic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 7df72f4..be76fbd 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -123,7 +123,7 @@ static FslMpicInfo fsl_mpic_42 = { #define TCCR_TOG 0x80000000 /* toggles when decrement to zero */ #define IDR_EP_SHIFT 31 -#define IDR_EP_MASK (1 << IDR_EP_SHIFT) +#define IDR_EP_MASK (1U << IDR_EP_SHIFT) #define IDR_CI0_SHIFT 30 #define IDR_CI1_SHIFT 29 #define IDR_P1_SHIFT 1 @@ -220,17 +220,17 @@ typedef struct IRQSource { } IRQSource; #define IVPR_MASK_SHIFT 31 -#define IVPR_MASK_MASK (1 << IVPR_MASK_SHIFT) +#define IVPR_MASK_MASK (1U << IVPR_MASK_SHIFT) #define IVPR_ACTIVITY_SHIFT 30 -#define IVPR_ACTIVITY_MASK (1 << IVPR_ACTIVITY_SHIFT) +#define IVPR_ACTIVITY_MASK (1U << IVPR_ACTIVITY_SHIFT) #define IVPR_MODE_SHIFT 29 -#define IVPR_MODE_MASK (1 << IVPR_MODE_SHIFT) +#define IVPR_MODE_MASK (1U << IVPR_MODE_SHIFT) #define IVPR_POLARITY_SHIFT 23 -#define IVPR_POLARITY_MASK (1 << IVPR_POLARITY_SHIFT) +#define IVPR_POLARITY_MASK (1U << IVPR_POLARITY_SHIFT) #define IVPR_SENSE_SHIFT 22 -#define IVPR_SENSE_MASK (1 << IVPR_SENSE_SHIFT) +#define IVPR_SENSE_MASK (1U << IVPR_SENSE_SHIFT) -#define IVPR_PRIORITY_MASK (0xF << 16) +#define IVPR_PRIORITY_MASK (0xFU << 16) #define IVPR_PRIORITY(_ivprr_) ((int)(((_ivprr_) & IVPR_PRIORITY_MASK) >> 16)) #define IVPR_VECTOR(opp, _ivprr_) ((_ivprr_) & (opp)->vector_mask)