From patchwork Mon Mar 17 16:00:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26391 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C51B20143 for ; Mon, 17 Mar 2014 16:00:44 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id h18sf10237127igc.3 for ; Mon, 17 Mar 2014 09:00:44 -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=mOn+FiG9UEVnUrt3i/HL4vpGMoCtyeyy3UeT0TT/vgg=; b=nGuoBuPtXr/o1jcn8VdSoe34yj6MnqwgElVcVn4xT3ke/04K9FP7UFzqdNFwuiqe+y 4pVErKXuEGsxGlIg8KNOge7776XDwDFMp5Fe5pkD89B32O4wYzwli0ETcjneM+BYEjK+ xaQpEmys5hyXShcik6eL/7Wy87sg4nGKEU0cb/xVSERJpZ9EiEJDTPpgePCo4eWI6ScR t8hd+N8cVQ4nPqB2mbd1dEkWJYm442KmKmHgmN7ZI9nXAq4pT24rQp1JHrSxUMKOKS3D x+Cn7mvr4f/TEktRGsK1/wvPDLLLB2lalhwEi70mufsdiWIRoDjQGjxg0mGa4qS4bJ0I DSxw== X-Gm-Message-State: ALoCoQlPnOUJzaZE7zM02Y0y3dCgox2ykWW0KJP+yqSBzzQXtDh4zJhYBSh8DIxPJ5GFG6Z3KzeO X-Received: by 10.182.81.7 with SMTP id v7mr9734370obx.28.1395072044079; Mon, 17 Mar 2014 09:00:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.9 with SMTP id k9ls825995qgk.20.gmail; Mon, 17 Mar 2014 09:00:44 -0700 (PDT) X-Received: by 10.52.165.14 with SMTP id yu14mr15846vdb.81.1395072043996; Mon, 17 Mar 2014 09:00:43 -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 b4si5408771vck.82.2014.03.17.09.00.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 09:00:43 -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 ld13so6011694vcb.33 for ; Mon, 17 Mar 2014 09:00:43 -0700 (PDT) X-Received: by 10.52.34.4 with SMTP id v4mr545292vdi.42.1395072043910; Mon, 17 Mar 2014 09:00:43 -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 i9csp137540vck; Mon, 17 Mar 2014 09:00:43 -0700 (PDT) X-Received: by 10.205.6.7 with SMTP id oi7mr526403bkb.62.1395072042398; Mon, 17 Mar 2014 09:00:42 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id nt3si4643995bkb.130.2014.03.17.09.00.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 09:00:42 -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-0004vf-6i; 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 03/12] hw/pci/pci_host.c: Avoid shifting left into sign bit Date: Mon, 17 Mar 2014 16:00:32 +0000 Message-Id: <1395072041-18911-4-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 to avoid undefined behaviour. Signed-off-by: Peter Maydell Reviewed-by: Michael S. Tsirkin --- hw/pci/pci_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 77c7d1f..2c17916 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -142,8 +142,9 @@ static uint64_t pci_host_data_read(void *opaque, { PCIHostState *s = opaque; uint32_t val; - if (!(s->config_reg & (1 << 31))) + if (!(s->config_reg & (1u << 31))) { return 0xffffffff; + } val = pci_data_read(s->bus, s->config_reg | (addr & 3), len); PCI_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n", addr, len, val);