From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [kvm-unit-tests PATCH 1/6] fix conversions in report()s Date: Wed, 17 May 2017 22:14:00 +0200 Message-ID: <20170517201405.19867-2-rkrcmar@redhat.com> References: <20170517201405.19867-1-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54604 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754323AbdEQUPL (ORCPT ); Wed, 17 May 2017 16:15:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 188227247C for ; Wed, 17 May 2017 20:15:11 +0000 (UTC) In-Reply-To: <20170517201405.19867-1-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Fix conversions that would trigger a warning if the format was checked by a compiler. Signed-off-by: Radim Krčmář --- arm/selftest.c | 2 +- powerpc/selftest.c | 2 +- powerpc/spapr_hcall.c | 2 +- x86/asyncpf.c | 6 +++--- x86/hyperv_synic.c | 2 +- x86/tsc.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arm/selftest.c b/arm/selftest.c index 750e90893141..f305f4e3be19 100644 --- a/arm/selftest.c +++ b/arm/selftest.c @@ -37,7 +37,7 @@ static void check_setup(int argc, char **argv) phys_addr_t memsize = PHYS_END - PHYS_OFFSET; phys_addr_t expected = ((phys_addr_t)val)*1024*1024; - report("size = %d MB", memsize == expected, + report("size = %" PRIu64 " MB", memsize == expected, memsize/1024/1024); ++nr_tests; diff --git a/powerpc/selftest.c b/powerpc/selftest.c index 8c5ff0ac889d..4e29fd6bbd56 100644 --- a/powerpc/selftest.c +++ b/powerpc/selftest.c @@ -28,7 +28,7 @@ static void check_setup(int argc, char **argv) phys_addr_t memsize = PHYSICAL_END - PHYSICAL_START; phys_addr_t expected = ((phys_addr_t)val)*1024*1024; - report("size = %d MB", memsize == expected, + report("size = %" PRIu64 " MB", memsize == expected, memsize/1024/1024); ++nr_tests; diff --git a/powerpc/spapr_hcall.c b/powerpc/spapr_hcall.c index 656aaff61405..bd6c287a2f0c 100644 --- a/powerpc/spapr_hcall.c +++ b/powerpc/spapr_hcall.c @@ -49,7 +49,7 @@ static void test_h_set_sprg0(int argc, char **argv) rc = hcall(H_SET_SPRG0, sprg0_orig); sprg0 = mfspr(SPR_SPRG0); - report("sprg0 = 0x%llx", + report("sprg0 = 0x%" PRIx64, rc == H_SUCCESS && sprg0 == sprg0_orig, sprg0_orig); } diff --git a/x86/asyncpf.c b/x86/asyncpf.c index e29e07c556f3..fea1d28ef375 100644 --- a/x86/asyncpf.c +++ b/x86/asyncpf.c @@ -52,13 +52,13 @@ static void pf_isr(struct ex_regs *r) switch (reason) { case 0: - report("unexpected #PF at %p", false, read_cr2()); + report("unexpected #PF at 0x%lx", false, read_cr2()); break; case KVM_PV_REASON_PAGE_NOT_PRESENT: phys = virt_to_phys_cr3(virt); install_pte(phys_to_virt(read_cr3()), 1, virt, phys, 0); write_cr3(read_cr3()); - report("Got not present #PF token %x virt addr %p phys addr %p", + report("Got not present #PF token %lx virt addr %p phys addr 0x%" PRIx64, true, read_cr2(), virt, phys); while(phys) { safe_halt(); /* enables irq */ @@ -66,7 +66,7 @@ static void pf_isr(struct ex_regs *r) } break; case KVM_PV_REASON_PAGE_READY: - report("Got present #PF token %x", true, read_cr2()); + report("Got present #PF token %lx", true, read_cr2()); if ((uint32_t)read_cr2() == ~0) break; install_pte(phys_to_virt(read_cr3()), 1, virt, phys | PT_PRESENT_MASK | PT_WRITABLE_MASK, 0); diff --git a/x86/hyperv_synic.c b/x86/hyperv_synic.c index 74bbd58ee983..d1f75c588e1c 100644 --- a/x86/hyperv_synic.c +++ b/x86/hyperv_synic.c @@ -90,7 +90,7 @@ static void synic_test_prepare(void *ctx) } r = rdmsr(HV_X64_MSR_EOM); if (r != 0) { - report("Hyper-V SynIC test, EOM read 0x%llx", false, r); + report("Hyper-V SynIC test, EOM read 0x%" PRIx64, false, r); goto ret; } diff --git a/x86/tsc.c b/x86/tsc.c index 62450e71725c..6dc05af27eaf 100644 --- a/x86/tsc.c +++ b/x86/tsc.c @@ -23,7 +23,7 @@ void test_rdtscp(u64 aux) wrmsr(MSR_TSC_AUX, aux); rdtscp(&ecx); - report("Test RDTSCP %d", ecx == aux, aux); + report("Test RDTSCP %" PRIu64, ecx == aux, aux); } int main() -- 2.13.0