From patchwork Mon Mar 17 16:00:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26398 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA8C520143 for ; Mon, 17 Mar 2014 16:26:53 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id e16sf13715314qcx.2 for ; Mon, 17 Mar 2014 09:26:53 -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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Jh1LmTPQn9MosaGNbrkbYHw3OddOVxPp9H9DYZ/19iQ=; b=P3MtImI4h/+rbZHjqQrnLAGNmjGstn1Id+X4BFTgDopJaB6qt7AcQRgq7QbOlqBgLs 1/sroK8a0Bsp3I0aLz2UhvaeN2gBFE38o+kimzyNP8/HoIjpf1Yk7zRGPLbQhn0cCWkr 1Gm1Ru4LOSPMPLXT1dDdv4MoiWbyeXoTcqF9+p9BazbtgbQQdh9zHBUTL2W95/1az4af 8lzm1BgX3ZwrqCk/i6aZJVct15BKIdCsq2nD8BPrNzi6fwl3fF4+mNPU3obuxzGOLOBQ l+KrS37rrg8CGtti7li80Cm5IakvEOcLvAN3wJGCad/05Nbq+AY05F4xOvAvq43m9zzR mHrA== X-Gm-Message-State: ALoCoQkS+0ZMFfiv6o5cwcXwLsQz8Y6XkjNgBHzfsK4D7lJo4cMcFmmhPRI4IAwDXctJ9XO53/d6 X-Received: by 10.52.53.73 with SMTP id z9mr8361179vdo.4.1395073613355; Mon, 17 Mar 2014 09:26:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.85 with SMTP id o79ls629009qgd.12.gmail; Mon, 17 Mar 2014 09:26:53 -0700 (PDT) X-Received: by 10.220.197.2 with SMTP id ei2mr75972vcb.63.1395073613260; Mon, 17 Mar 2014 09:26:53 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id sv2si1898639vdc.39.2014.03.17.09.26.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 09:26:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so5911178vcb.5 for ; Mon, 17 Mar 2014 09:26:53 -0700 (PDT) X-Received: by 10.52.12.36 with SMTP id v4mr17679031vdb.20.1395073613141; Mon, 17 Mar 2014 09:26:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp139322vck; Mon, 17 Mar 2014 09:26:52 -0700 (PDT) X-Received: by 10.194.9.99 with SMTP id y3mr2484366wja.60.1395073611981; Mon, 17 Mar 2014 09:26:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fx17si5388978wic.45.2014.03.17.09.26.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 09:26:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WPZxx-0004wJ-GQ; Mon, 17 Mar 2014 16:00:41 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 09/12] tests/libqos/pci-pc: Avoid shifting left into sign bit Date: Mon, 17 Mar 2014 16:00:38 +0000 Message-Id: <1395072041-18911-10-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> References: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add U suffix when doing "1 << 31" to avoid undefined behaviour. Signed-off-by: Peter Maydell --- tests/libqos/pci-pc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index 3bde8ab..bf741a4 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -110,37 +110,37 @@ static void qpci_pc_io_writel(QPCIBus *bus, void *addr, uint32_t value) static uint8_t qpci_pc_config_readb(QPCIBus *bus, int devfn, uint8_t offset) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); return inb(0xcfc); } static uint16_t qpci_pc_config_readw(QPCIBus *bus, int devfn, uint8_t offset) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); return inw(0xcfc); } static uint32_t qpci_pc_config_readl(QPCIBus *bus, int devfn, uint8_t offset) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); return inl(0xcfc); } static void qpci_pc_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); outb(0xcfc, value); } static void qpci_pc_config_writew(QPCIBus *bus, int devfn, uint8_t offset, uint16_t value) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); outw(0xcfc, value); } static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint32_t value) { - outl(0xcf8, (1 << 31) | (devfn << 8) | offset); + outl(0xcf8, (1U << 31) | (devfn << 8) | offset); outl(0xcfc, value); }