Thread (25 messages) 25 messages, 3 authors, 2018-05-25

[PATCH 03/19] ppc32: Change %.16x into %p

From: Mathieu Malaterre <hidden>
Date: 2018-03-16 11:02:51
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

  CC      arch/powerpc/xmon/xmon.o
arch/powerpc/xmon/xmon.c: In function ‘memdiffs’:
arch/powerpc/xmon/xmon.c:2863:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘unsigned char *’ [-Werror=format=]
     printf("%.16x %.2x # %.16x %.2x\n", p1 - 1,
                 ^
arch/powerpc/xmon/xmon.c:2863:30: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘unsigned char *’ [-Werror=format=]
     printf("%.16x %.2x # %.16x %.2x\n", p1 - 1,
                              ^
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <redacted>
---
 arch/powerpc/xmon/xmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index ee7a8c9a042b..f155f030550f 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2860,7 +2860,7 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
 	for( n = nb; n > 0; --n )
 		if( *p1++ != *p2++ )
 			if( ++prt <= maxpr )
-				printf("%.16x %.2x # %.16x %.2x\n", p1 - 1,
+				printf("%p %.2x # %p %.2x\n", p1 - 1,
 					p1[-1], p2 - 1, p2[-1]);
 	if( prt > maxpr )
 		printf("Total of %d differences\n", prt);
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help