From patchwork Mon Mar 10 19:10:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26003 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6EA3E2054B for ; Mon, 10 Mar 2014 19:11:52 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf29912743ieb.5 for ; Mon, 10 Mar 2014 12:11:51 -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=RqlvV5PpJw6sivOQK0Svl/Eb/bz4eUvhrbML84rSy+c=; b=Osbw98gFzcgleCMTQfCOaUxHxTdBZt6D1hJ+T6bPYwkDObgrIkIP0XxvsjgFsAqzAq PEs8lk6GPoDtRrtBsKjV5fjD8JyGQrNVOxUPIiHETQTg8+o46UcmqUz0Kg1B7t2UYTt5 +rpf0VnRuAoGPEQ5/u0+oJaVOsHFIp+F07PnKAcGP2bntCNkKeHnGd9lRIkWwzYfgDBA OhT6vOlt/Qr5EfbHZ5VcqSgKnbO/DSYMVGTIDw7V98LhusiEmrDNLjY6AOvHgFA+yK4h LgZpRg8/cT3Y0AJb2Rg/7aDcgsETUkAoykvcGJTFMakEh7F6Rt3KGCNnS0LZ0MRzjaOI Pcjw== X-Gm-Message-State: ALoCoQllJYXM3iuhKXVSc3hZcbXXBxruClkmdp1s0StTuBvnKH9dOuCoQBi8U+5I14gUn4kb9HIm X-Received: by 10.182.87.2 with SMTP id t2mr15469672obz.2.1394478711883; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.230 with SMTP id z93ls2362464qgz.93.gmail; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) X-Received: by 10.58.161.227 with SMTP id xv3mr1618656veb.31.1394478711706; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id sn5si926331vdc.89.2014.03.10.12.11.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Mar 2014 12:11:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 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.179; Received: by mail-ve0-f179.google.com with SMTP id db12so7643488veb.10 for ; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) X-Received: by 10.220.161.8 with SMTP id p8mr23781730vcx.4.1394478711646; Mon, 10 Mar 2014 12:11:51 -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 i9csp142028vck; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) X-Received: by 10.229.171.8 with SMTP id f8mr36522862qcz.13.1394478711224; Mon, 10 Mar 2014 12:11:51 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id d69si8206919qga.130.2014.03.10.12.11.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Mar 2014 12:11:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:50741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN5c6-0005ka-Pn for patch@linaro.org; Mon, 10 Mar 2014 15:11:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN5bD-0004hI-4x for qemu-devel@nongnu.org; Mon, 10 Mar 2014 15:10:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN5bA-0003KC-TA for qemu-devel@nongnu.org; Mon, 10 Mar 2014 15:10:55 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN5bA-0003JG-Fk; Mon, 10 Mar 2014 15:10:52 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WN5b7-0002T7-4x; Mon, 10 Mar 2014 19:10:49 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 10 Mar 2014 19:10:39 +0000 Message-Id: <1394478649-9453-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394478649-9453-1-git-send-email-peter.maydell@linaro.org> References: <1394478649-9453-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, patches@linaro.org Subject: [Qemu-devel] [PATCH 03/12] hw/pci/pci_host.c: 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: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.179 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 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);