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: 9510601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D08BF606E1 for ; Wed, 11 Jan 2017 16:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2E302841B for ; Wed, 11 Jan 2017 16:29:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A77C528407; Wed, 11 Jan 2017 16:29:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8AE285CA for ; Wed, 11 Jan 2017 16:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030667AbdAKQ3E (ORCPT ); Wed, 11 Jan 2017 11:29:04 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36238 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030654AbdAKQ2z (ORCPT ); Wed, 11 Jan 2017 11:28:55 -0500 Received: by mail-wm0-f44.google.com with SMTP id c85so162314952wmi.1 for ; Wed, 11 Jan 2017 08:28:54 -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=WU+nstBqfBVMHzdyrs2aScb+C4fKC2ZjT9jGxqUhYfe0z26i7SvWg5Tb3T3OA895jc A7BsUIovlsEJ51VRr2GQ24r/S5WFPcy/OvXd39SpFKUVN45WtEzk42lHewFdnt4ygxaj KHXDqtAeCteuGmrPDJFDnjyI3R/SCRk+us7Ko6ZwMmj5dCQwLLuOxB5CFbcJyFKC6wdJ OMSI76rO/gyB/aNxLooktWc1FDGZ93LI/9kMj+s/zPozWDDj+ir56b1nXLwhWazkRw0H E5md8ZDV2C9Uz6sxCuMRcWhtaVmgI9NLufwuiVtCNHXNQsx9LOcT5le0atp9ZMS+zAwL M1wQ== X-Gm-Message-State: AIkVDXLH9H9lJTWwcpN/U6mi27UK5A9LExkKE8H2nMLbW+8CWaaZ8h4gRyPVF+en+rnYvSro 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 Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }