diff mbox series

p8chip: Fix printf format warnings

Message ID 20190327042648.4424-1-joel@jms.id.au
State Accepted
Headers show
Series p8chip: Fix printf format warnings | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (6b57cfc68252de3e4114c02034e747995a22affa)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Joel Stanley March 27, 2019, 4:26 a.m. UTC
When building for powerpc64:

libpdbg/p8chip.c: In function ‘emulate_sreset’:
libpdbg/p8chip.c:493:36: error: format ‘%llx’ expects argument of type
‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long
unsigned int’} [-Werror=format=]
  printf("emulate sreset old NIA:%llx MSR:%llx\n", old_nia, old_msr);
                                 ~~~^              ~~~~~~~
                                 %lx

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 libpdbg/p8chip.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 062da3993111..5bd790143cbf 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -490,8 +490,10 @@  static int emulate_sreset(struct thread *thread)
 		new_msr |= MSR_LE;
 	else
 		new_msr &= ~MSR_LE;
-	printf("emulate sreset old NIA:%llx MSR:%llx\n", old_nia, old_msr);
-	printf("emulate sreset new NIA:%llx MSR:%llx\n", new_nia, new_msr);
+	printf("emulate sreset old NIA:%"PRIx64" MSR:%"PRIx64"\n",
+			old_nia, old_msr);
+	printf("emulate sreset new NIA:%"PRIx64" MSR:%"PRIx64"\n",
+			new_nia, new_msr);
 	CHECK_ERR(ram_putspr(&thread->target, SPR_SRR0, old_nia));
 	CHECK_ERR(ram_putspr(&thread->target, SPR_SRR1, old_msr));
 	CHECK_ERR(ram_putnia(&thread->target, new_nia));