summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/xmon.h
diff options
context:
space:
mode:
authorMathieu Malaterre <malat@debian.org>2018-03-25 11:06:47 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-05-25 12:04:36 +1000
commite70d8f55268ba95f00c61857df2bab638365f10f (patch)
tree59612895eef9d3225e6c57529624d6c080cc0cc1 /arch/powerpc/include/asm/xmon.h
parent6671683db8540e5766f44a1089549c168730ae41 (diff)
downloadlinux-e70d8f55268ba95f00c61857df2bab638365f10f.tar.bz2
powerpc/xmon: Add __printf annotation to xmon_printf()
This allows the compiler to verify the format strings vs the types of the arguments. Update the other prototype declarations in asm/xmon.h. Silence warnings (triggered at W=1) by adding relevant __printf attribute. Move #define at bottom of the file to prevent conflict with gcc attribute. Solves the original warning: arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute In turn this uncovered many formatting errors in xmon.c, all fixed in this patch. Signed-off-by: Mathieu Malaterre <malat@debian.org> [mpe: Always use px not p, fixup the 44x specific code, tweak change log] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/xmon.h')
-rw-r--r--arch/powerpc/include/asm/xmon.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/xmon.h b/arch/powerpc/include/asm/xmon.h
index eb42a0c6e1d9..30ff69bd8f43 100644
--- a/arch/powerpc/include/asm/xmon.h
+++ b/arch/powerpc/include/asm/xmon.h
@@ -29,7 +29,7 @@ static inline void xmon_register_spus(struct list_head *list) { };
extern int cpus_are_in_xmon(void);
#endif
-extern void xmon_printf(const char *format, ...);
+extern __printf(1, 2) void xmon_printf(const char *format, ...);
#endif /* __KERNEL __ */
#endif /* __ASM_POWERPC_XMON_H */