diff mbox

[kvm-unit-tests,1/6] fix conversions in report()s

Message ID 20170517201405.19867-2-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář May 17, 2017, 8:14 p.m. UTC
Fix conversions that would trigger a warning if the format was checked
by a compiler.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 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(-)

Comments

Thomas Huth May 18, 2017, 2:34 a.m. UTC | #1
On 17.05.2017 22:14, Radim Krčmář wrote:
> Fix conversions that would trigger a warning if the format was checked
> by a compiler.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  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(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
David Hildenbrand May 18, 2017, 8:03 a.m. UTC | #2
On 17.05.2017 22:14, Radim Krčmář wrote:
> Fix conversions that would trigger a warning if the format was checked
> by a compiler.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  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(-)
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox

Patch

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()