From patchwork Wed Jan 11 16:28:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 90939 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1204079qgi; Wed, 11 Jan 2017 08:30:14 -0800 (PST) X-Received: by 10.84.129.131 with SMTP id b3mr14277432plb.54.1484152214078; Wed, 11 Jan 2017 08:30:14 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 9si6253041pgp.126.2017.01.11.08.30.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 08:30:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRLmu-0003EB-Qj; Wed, 11 Jan 2017 16:30:12 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRLlz-00005P-NH for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2017 16:29:18 +0000 Received: by mail-wm0-x22c.google.com with SMTP id r126so16749740wmr.0 for ; Wed, 11 Jan 2017 08:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ygUGGM0WRBJ788r6EZZryCStRGTY5vQ75eATYqoYm90=; b=PA/weQ+UP3wUtJstOAjKUVPIUZeYeg1Q6tcQDFB//EMT9Jbz6d9aArGq7vT8um6kUt fmsXpsptpS5LGr7QdeGrYHx9LZLxXNe6FmMdsQuRmiQxDDQQEhjwqu+5+vdUkNCQeuyL FLRAeto0aZcDEXIJFz8M8XieSsnTeo6YbIhAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ygUGGM0WRBJ788r6EZZryCStRGTY5vQ75eATYqoYm90=; b=EIySmtqhrERtmR1Hrd1SzIjDtyw1Kqq+oFrdj5Y0G60BWGpSd6GEOKN4jhZPqq9aKx YywIrHzhgdIyitRIe5HCOQT5QlDXj+/3xUorXiPBuQ7g2XvKy4nMpHOVy9pLU3LCA2bD ywv7oK56yBzG9zeyGXh7SW9XhmHQiC/wuh2G7P5aKOT60ZVdEDAg4FrEeuTnymvwoxwS jxt24GrwyQEapr+OdPBHxNfNHhGzli6SLTqGWV9OTlsJ8QyzikU3M1onMjVTPzwS+ctL rzxbHpnL4SpCFYPBTNIN+nt+AuY+cIM373GZdgwCELoIkCtMjrXxVazdWHPhUXl2OSmT agGw== X-Gm-Message-State: AIkVDXLp/nqjp2gjsOX6wgg0U6C3ZQZnuYx4+/C/OAIril5vnM/tqkQsOlvfqj931+Km6vzZ X-Received: by 10.28.107.77 with SMTP id g74mr3716495wmc.109.1484152133797; Wed, 11 Jan 2017 08:28:53 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id yy7sm9258293wjc.3.2017.01.11.08.28.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 08:28:51 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BC4063E0672; Wed, 11 Jan 2017 16:28:48 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: drjones@redhat.com, pbonzini@redhat.com Subject: [kvm-unit-tests PATCH 2/6] lib/pci: fix BAR format strings Date: Wed, 11 Jan 2017 16:28:37 +0000 Message-Id: <20170111162841.15569-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170111162841.15569-1-alex.bennee@linaro.org> References: <20170111162841.15569-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_082915_985504_03BEE1E4 X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Using %x as a format string is not portable across 32/64 bit builds. Use explicit PRIx32 format strings like the 64 bit version above. Signed-off-by: Alex Bennée --- lib/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pci.c b/lib/pci.c index 6416191..597d8f2 100644 --- a/lib/pci.c +++ b/lib/pci.c @@ -67,7 +67,7 @@ bool pci_setup_msi(struct pci_dev *dev, uint64_t msi_addr, uint32_t msi_data) pci_config_writel(addr, offset + PCI_MSI_DATA_32, msi_data); printf("MSI: dev 0x%x init 32bit address: ", addr); } - printf("addr=0x%lx, data=0x%x\n", msi_addr, msi_data); + printf("addr=0x%" PRIx64 ", data=0x%" PRIx32 "\n", msi_addr, msi_data); msi_control |= PCI_MSI_FLAGS_ENABLE; pci_config_writew(addr, offset + PCI_MSI_FLAGS, msi_control); @@ -237,7 +237,7 @@ void pci_bar_print(struct pci_dev *dev, int bar_num) printf("BAR#%d,%d [%" PRIx64 "-%" PRIx64 " ", bar_num, bar_num + 1, start, end); } else { - printf("BAR#%d [%02x-%02x ", + printf("BAR#%d [%" PRIx32 "-%" PRIx32 " ", bar_num, (uint32_t)start, (uint32_t)end); }