From patchwork Thu Mar 27 15:28:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 27227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77211202FA for ; Thu, 27 Mar 2014 16:09:21 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id hw13sf7221967qab.9 for ; Thu, 27 Mar 2014 09:09:21 -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=HxTwH6+EbOi98vvFkqFPHaE9N3ceXzakiXbDOms4ltE=; b=HOTssBXiW48/n//G3LgsG2C5tsFW4l6zFH8sURMc9J0aL0La6bqF5tlKwU1D67m3/f ug8TqNLF0krTppOMqgTAEtEqRMqfS8VrNUn4lSAwzw3zLf2Syzcf0iUU3DU13EOP3lcF LQ9hOLk+o5EPKR//LaWwsy8i/lsMkq5EApYlj6ub4FBjpSkvKdps5ea2FCHDF/fl75II rHkZ1DUlEJeM7maXXEbuwDfpU9jW+JpOeUs4kBx3r8QCI9QY59fGCQo/hjEYXKtBUcGq 63eVKj4fyi+h+0674XmmPIWvjzhhkeSi0gCmTjX+Zf5vjMItTG2HaEG85D8HUKEpbG/x whVg== X-Gm-Message-State: ALoCoQmXE2OP9wJGEVpYvoB4XRdMsPDKxKVa8lNaQrXkQMbS9/1fb7QNPGPQuoquhFy4GWmHcpc9 X-Received: by 10.224.13.12 with SMTP id z12mr1022456qaz.7.1395936561310; Thu, 27 Mar 2014 09:09:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.38 with SMTP id 35ls1169026qgw.77.gmail; Thu, 27 Mar 2014 09:09:21 -0700 (PDT) X-Received: by 10.52.253.75 with SMTP id zy11mr1865008vdc.10.1395936561234; Thu, 27 Mar 2014 09:09:21 -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 x7si662417vel.0.2014.03.27.09.09.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:09:21 -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 il7so4504765vcb.32 for ; Thu, 27 Mar 2014 09:09:21 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr2086097vcw.15.1395936561119; Thu, 27 Mar 2014 09:09:21 -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 i9csp40403vck; Thu, 27 Mar 2014 09:09:20 -0700 (PDT) X-Received: by 10.140.96.195 with SMTP id k61mr3066821qge.60.1395936560635; Thu, 27 Mar 2014 09:09:20 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c3si1219671qan.270.2014.03.27.09.09.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:09:20 -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]:54695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCro-0006zd-3K for patch@linaro.org; Thu, 27 Mar 2014 12:09:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqj-0005lU-Tk for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCqZ-0000ut-VM for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:13 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:47445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqZ-0000uK-Ma; Thu, 27 Mar 2014 12:08:03 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8D35E43721; 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 78D5A695; Thu, 27 Mar 2014 19:28:36 +0400 (MSK) Received: (nullmailer pid 1804 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:23 +0400 Message-Id: <1395934108-1694-19-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 18/23] tests/libqos/pci-pc: 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 when doing "1 << 31" to avoid undefined behaviour. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- 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); }