* [PATCH 00/19] Start using __printf attribute (single commit series) @ 2018-03-16 11:02 Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre ` (18 more replies) 0 siblings, 19 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre This series is part of my warning fixes branch. When preparing the patch, I figured that sending it as single patch would make the reviewing task fairly difficult. I decided to split it into fake commits and group them by warning types to make reviewing much easier. Obviously this series is not meant to be applied as-is but squashed into a single commit (maybe two if I move the gcc attribute as second patch). I saw that my previous patches were applied with a trimmed warning context to reduce the level of noise, I'll keep that in mind when preparing the squashed commit. This series has only been compiled tested using ppc32_defconfig and ppc64_defconfig, hopefully those two cover all combinations for this piece of code. I am not sure what (if anything?) I am going to break when replacing %016lx with %p on 32 bits arch, the other changes seems more direct. I am open for suggestion for the last commit (maybe combine the two function-like macros DUMP & DUMPPTR into a single one with an extra parameter). Mathieu Malaterre (19): xmon: Use __printf markup to silence compiler ppc32: change %x into %lx ppc32: Change %.16x into %p ppc32: change %lx into %p ppc32: change %lx into %tx (ptrdiff_t) ppc64: change %lx into %llx ppc64: change %ld into %d ppc64: change %x into %lx ppc64: change %016lx into %p ppc64: change %lx into %p ppc64: change %lx into %x ppc64: change %lx into %llx ppc64: change %llx into %lx ppc64: change %p into %llx ppc64: change %d into %ld ppc64: Change %d into %lu ppc64: change %d into %llu ppc64: change %ld into %d ppc64: Handle %p format in DUMPPTR() function-like macro arch/powerpc/include/asm/xmon.h | 2 +- arch/powerpc/xmon/nonstdio.h | 8 +-- arch/powerpc/xmon/spu-dis.c | 18 +++--- arch/powerpc/xmon/xmon.c | 133 ++++++++++++++++++++-------------------- 4 files changed, 82 insertions(+), 79 deletions(-) -- 2.11.0 ^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 01/19] xmon: Use __printf markup to silence compiler 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-17 23:33 ` kbuild test robot ` (2 more replies) 2018-03-16 11:02 ` [PATCH 02/19] ppc32: change %x into %lx Mathieu Malaterre ` (17 subsequent siblings) 18 siblings, 3 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre Update also the other prototype declaration 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. CC arch/powerpc/xmon/nonstdio.o arch/powerpc/xmon/nonstdio.c: In function ‘xmon_printf’: arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/include/asm/xmon.h | 2 +- arch/powerpc/xmon/nonstdio.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 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 */ diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 2202ec61972c..e8deac6c84e2 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h @@ -1,13 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0 */ #define EOF (-1) -#define printf xmon_printf -#define putchar xmon_putchar - extern void xmon_set_pagination_lpp(unsigned long lpp); extern void xmon_start_pagination(void); extern void xmon_end_pagination(void); extern int xmon_putchar(int c); extern void xmon_puts(const char *); extern char *xmon_gets(char *, int); -extern void xmon_printf(const char *, ...); +extern __printf(1, 2) void xmon_printf(const char *fmt, ...); + +#define printf xmon_printf +#define putchar xmon_putchar -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 01/19] xmon: Use __printf markup to silence compiler 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre @ 2018-03-17 23:33 ` kbuild test robot 2018-03-18 0:27 ` kbuild test robot 2018-03-25 9:06 ` [PATCH v2] " Mathieu Malaterre 2 siblings, 0 replies; 25+ messages in thread From: kbuild test robot @ 2018-03-17 23:33 UTC (permalink / raw) To: Mathieu Malaterre Cc: kbuild-all, Michael Ellerman, Mathieu Malaterre, Paul Mackerras, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 45465 bytes --] Hi Mathieu, Thank you for the patch! Yet something to improve: [auto build test ERROR on v4.16-rc4] [also build test ERROR on next-20180316] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Mathieu-Malaterre/Start-using-__printf-attribute-single-commit-series/20180318-035038 config: powerpc64-defconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=powerpc64 Note: the linux-review/Mathieu-Malaterre/Start-using-__printf-attribute-single-commit-series/20180318-035038 HEAD 070c2d653f1924feb0363271515fea85920b80f9 builds fine. It only hurts bisectibility. All error/warnings (new ones prefixed by >>): arch/powerpc/xmon/xmon.c: In function 'cpu_cmd': >> arch/powerpc/xmon/xmon.c:1168:18: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("cpu 0x%x isn't in xmon\n", cpu); ~^ %lx arch/powerpc/xmon/xmon.c:1182:19: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("cpu 0x%x didn't take control\n", cpu); ~^ %lx arch/powerpc/xmon/xmon.c: In function 'bpt_cmds': arch/powerpc/xmon/xmon.c:1392:15: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long int' [-Werror=format=] printf("%2x %s ", BP_NUM(bp), ~~^ %2lx arch/powerpc/xmon/xmon.c: In function 'excprint': arch/powerpc/xmon/xmon.c:1607:31: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'struct pt_regs *' [-Werror=format=] printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp); ~~^ arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [-Werror=format-extra-args] printf(" lr: ", fp->link); ^~~~~~~~~~ arch/powerpc/xmon/xmon.c:1623:26: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'struct task_struct *' [-Werror=format=] printf(" current = 0x%lx\n", current); ~~^ >> arch/powerpc/xmon/xmon.c:1625:26: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'struct paca_struct *' [-Werror=format=] printf(" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n", ~~^ arch/powerpc/xmon/xmon.c:1629:25: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'pid_t {aka int}' [-Werror=format=] printf(" pid = %ld, comm = %s\n", ~~^ %d arch/powerpc/xmon/xmon.c: In function 'prregs': >> arch/powerpc/xmon/xmon.c:1665:17: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ~~~~^ %.2d arch/powerpc/xmon/xmon.c:1665:11: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^~~~~~~~~~~ n, fp->gpr[n], n+16, fp->gpr[n+16]); ~~~~ arch/powerpc/xmon/xmon.c:1665:34: note: format string is defined here printf("R%.2ld = "REG" R%.2ld = "REG"\n", ~~~~^ %.2d arch/powerpc/xmon/xmon.c:1669:17: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'int' [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ~~~~^ %.2d arch/powerpc/xmon/xmon.c:1669:11: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^~~~~~~~~~~ n, fp->gpr[n], n+7, fp->gpr[n+7]); ~~~ arch/powerpc/xmon/xmon.c:1669:34: note: format string is defined here printf("R%.2ld = "REG" R%.2ld = "REG"\n", ~~~~^ %.2d arch/powerpc/xmon/xmon.c: In function 'dump_206_sprs': arch/powerpc/xmon/xmon.c:1778:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1780:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("dscr = %.16lx ppr = %.16lx pir = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1788:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1792:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c: In function 'dump_207_sprs': arch/powerpc/xmon/xmon.c:1809:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("dpdes = %.16lx tir = %.16lx cir = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1812:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("fscr = %.16lx tar = %.16lx pspb = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1825:22: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1825:34: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1825:47: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1825:62: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1828:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c:1830:54: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("sdar = %.16lx sier = %.16lx pmc6 = %.8x\n", ~~~^ %.8lx arch/powerpc/xmon/xmon.c: In function 'dump_one_paca': >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2344:7: DUMP(p, kernel_toc, "lx"); ~~~~ >> arch/powerpc/xmon/xmon.c:2344:2: note: in expansion of macro 'DUMP' DUMP(p, kernel_toc, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2344:24: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2345:7: DUMP(p, kernelbase, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2345:2: note: in expansion of macro 'DUMP' DUMP(p, kernelbase, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2345:24: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2346:7: DUMP(p, kernel_msr, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2346:2: note: in expansion of macro 'DUMP' DUMP(p, kernel_msr, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2346:24: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2347:2: note: in expansion of macro 'DUMP' DUMP(p, emergency_sp, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2347:25: note: format string is defined here DUMP(p, emergency_sp, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2349:2: note: in expansion of macro 'DUMP' DUMP(p, nmi_emergency_sp, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2349:29: note: format string is defined here DUMP(p, nmi_emergency_sp, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2350:2: note: in expansion of macro 'DUMP' DUMP(p, mc_emergency_sp, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2350:28: note: format string is defined here DUMP(p, mc_emergency_sp, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2355:7: DUMP(p, data_offset, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2355:2: note: in expansion of macro 'DUMP' DUMP(p, data_offset, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2355:25: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~^ arch/powerpc/xmon/xmon.c:2370:44: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~^ %016llx arch/powerpc/xmon/xmon.c:2370:53: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~^ %016llx >> arch/powerpc/xmon/xmon.c:2377:43: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u32 {aka unsigned int}' [-Werror=format=] printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~^ ~~~~~~~~~~~~~~~ %016x >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2379:2: note: in expansion of macro 'DUMP' DUMP(p, rfi_flush_fallback_area, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2379:36: note: format string is defined here DUMP(p, rfi_flush_fallback_area, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2390:2: note: in expansion of macro 'DUMP' DUMP(p, __current, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2390:22: note: format string is defined here DUMP(p, __current, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2391:7: DUMP(p, kstack, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2391:2: note: in expansion of macro 'DUMP' DUMP(p, kstack, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2391:20: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hw_cpu_id, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, cpu_start, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kexec_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_NUM_BOLTED; i++) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ u64 esid, vsid; ~~~~~~~~~~~~~~~ if (!p->slb_shadow_ptr) ~~~~~~~~~~~~~~~~~~~~~~~ continue; ~~~~~~~~~ esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (esid || vsid) { ~~~~~~~~~~~~~~~~~~~ printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, esid, vsid); ~~~~~~~~~~~~~~~ } ~ } ~ DUMP(p, vmalloc_sllp, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, slb_cache_ptr, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_CACHE_ENTRIES; i++) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, rfi_flush_fallback_area, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, dscr_default, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3E ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, pgd, "px"); ~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_pgd, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, tcd_ptr, "px"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, crit_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, dbg_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, __current, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kstack, "lx"); ~~~~~~~~~~~~~~~~~~^ arch/powerpc/xmon/xmon.c:2392:41: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); ~~~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %016llx >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2393:7: DUMP(p, stab_rr, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2393:2: note: in expansion of macro 'DUMP' DUMP(p, stab_rr, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2393:21: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hw_cpu_id, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, cpu_start, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kexec_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_NUM_BOLTED; i++) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ u64 esid, vsid; ~~~~~~~~~~~~~~~ if (!p->slb_shadow_ptr) ~~~~~~~~~~~~~~~~~~~~~~~ continue; ~~~~~~~~~ esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (esid || vsid) { ~~~~~~~~~~~~~~~~~~~ printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, esid, vsid); ~~~~~~~~~~~~~~~ } ~ } ~ DUMP(p, vmalloc_sllp, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, slb_cache_ptr, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_CACHE_ENTRIES; i++) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, rfi_flush_fallback_area, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, dscr_default, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3E ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, pgd, "px"); ~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_pgd, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, tcd_ptr, "px"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, crit_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, dbg_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, __current, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kstack, "lx"); ~~~~~~~~~~~~~~~~~~~~~~ printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, stab_rr, "lx"); ~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2394:7: DUMP(p, saved_r1, "lx"); ~~~~ arch/powerpc/xmon/xmon.c:2394:2: note: in expansion of macro 'DUMP' DUMP(p, saved_r1, "lx"); ^~~~ arch/powerpc/xmon/xmon.c:2394:22: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hw_cpu_id, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, cpu_start, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kexec_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_NUM_BOLTED; i++) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ u64 esid, vsid; ~~~~~~~~~~~~~~~ if (!p->slb_shadow_ptr) ~~~~~~~~~~~~~~~~~~~~~~~ continue; ~~~~~~~~~ esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (esid || vsid) { ~~~~~~~~~~~~~~~~~~~ printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, esid, vsid); ~~~~~~~~~~~~~~~ } ~ } ~ DUMP(p, vmalloc_sllp, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, slb_cache_ptr, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_CACHE_ENTRIES; i++) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, rfi_flush_fallback_area, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, dscr_default, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3E ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, pgd, "px"); ~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_pgd, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, tcd_ptr, "px"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, crit_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, dbg_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, __current, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kstack, "lx"); ~~~~~~~~~~~~~~~~~~~~~~ printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, stab_rr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, saved_r1, "lx"); ~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with '%p' gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2408:2: note: in expansion of macro 'DUMP' DUMP(p, core_idle_state_ptr, "px"); ^~~~ arch/powerpc/xmon/xmon.c:2408:32: note: format string is defined here DUMP(p, core_idle_state_ptr, "px"); ^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'long unsigned int' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2414:7: DUMP(p, accounting.utime, "llx"); ~~~~~~~~~~~~~~~ arch/powerpc/xmon/xmon.c:2414:2: note: in expansion of macro 'DUMP' DUMP(p, accounting.utime, "llx"); ^~~~ arch/powerpc/xmon/xmon.c:2414:31: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hw_cpu_id, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, cpu_start, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kexec_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_NUM_BOLTED; i++) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ u64 esid, vsid; ~~~~~~~~~~~~~~~ if (!p->slb_shadow_ptr) ~~~~~~~~~~~~~~~~~~~~~~~ continue; ~~~~~~~~~ esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (esid || vsid) { ~~~~~~~~~~~~~~~~~~~ printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, esid, vsid); ~~~~~~~~~~~~~~~ } ~ } ~ DUMP(p, vmalloc_sllp, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, slb_cache_ptr, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_CACHE_ENTRIES; i++) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, rfi_flush_fallback_area, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, dscr_default, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3E ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, pgd, "px"); ~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_pgd, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, tcd_ptr, "px"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, crit_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, dbg_kstack, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, __current, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kstack, "lx"); ~~~~~~~~~~~~~~~~~~~~~~ printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, stab_rr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, saved_r1, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, trap_save, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, irq_soft_mask, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, irq_happened, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, io_sync, "x"); ~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, irq_work_pending, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nap_state_lost, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, sprg_vdso, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_TRANSACTIONAL_MEM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, tm_scratch, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ #ifdef CONFIG_PPC_POWERNV ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, core_idle_state_ptr, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, thread_idle_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, thread_mask, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, subcore_sibling_mask, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, accounting.utime, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/xmon/xmon.c:2339:9: error: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'long unsigned int' [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ arch/powerpc/xmon/xmon.c:2415:7: DUMP(p, accounting.stime, "llx"); ~~~~~~~~~~~~~~~ arch/powerpc/xmon/xmon.c:2415:2: note: in expansion of macro 'DUMP' DUMP(p, accounting.stime, "llx"); ^~~~ arch/powerpc/xmon/xmon.c:2415:31: note: format string is defined here printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ offsetof(struct paca_struct, name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, lock_token, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, paca_index, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_toc, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernelbase, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_msr, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, nmi_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, mc_emergency_sp, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_nmi, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, in_mce, "x"); ~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hmi_event_available, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, data_offset, "lx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, hw_cpu_id, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, cpu_start, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, kexec_state, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3S_64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_NUM_BOLTED; i++) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ u64 esid, vsid; ~~~~~~~~~~~~~~~ if (!p->slb_shadow_ptr) ~~~~~~~~~~~~~~~~~~~~~~~ continue; ~~~~~~~~~ esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (esid || vsid) { ~~~~~~~~~~~~~~~~~~~ printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, esid, vsid); ~~~~~~~~~~~~~~~ } ~ } ~ DUMP(p, vmalloc_sllp, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, slb_cache_ptr, "x"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < SLB_CACHE_ENTRIES; i++) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, rfi_flush_fallback_area, "px"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ DUMP(p, dscr_default, "llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #ifdef CONFIG_PPC_BOOK3E ~~~~~~~~~~~~~~~~~~~~~~~~ DUMP(p, pgd, "px"); ~~~~~~~~~~~~~~~~~~~ DUMP(p, kernel_pgd, "px"); .. vim +1168 arch/powerpc/xmon/xmon.c ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1138 ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1139 static int cpu_cmd(void) ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1140 { ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1141 #ifdef CONFIG_SMP fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1142 unsigned long cpu, first_cpu, last_cpu; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1143 int timeout; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1144 ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1145 if (!scanhex(&cpu)) { ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1146 /* print cpus waiting or in xmon */ ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1147 printf("cpus stopped:"); fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1148 last_cpu = first_cpu = NR_CPUS; bc1d77029 arch/powerpc/xmon/xmon.c Anton Blanchard 2012-06-28 1149 for_each_possible_cpu(cpu) { 104699c0a arch/powerpc/xmon/xmon.c KOSAKI Motohiro 2011-04-28 1150 if (cpumask_test_cpu(cpu, &cpus_in_xmon)) { fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1151 if (cpu == last_cpu + 1) { fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1152 last_cpu = cpu; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1153 } else { fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1154 if (last_cpu != first_cpu) 736256e4f arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 1155 printf("-0x%lx", last_cpu); fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1156 last_cpu = first_cpu = cpu; 736256e4f arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 1157 printf(" 0x%lx", cpu); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1158 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1159 } fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1160 } fd3bb9128 arch/powerpc/xmon/xmon.c Paul Mackerras 2013-09-03 1161 if (last_cpu != first_cpu) 736256e4f arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 1162 printf("-0x%lx", last_cpu); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1163 printf("\n"); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1164 return 0; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1165 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1166 /* try to switch to cpu specified */ 104699c0a arch/powerpc/xmon/xmon.c KOSAKI Motohiro 2011-04-28 1167 if (!cpumask_test_cpu(cpu, &cpus_in_xmon)) { ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 @1168 printf("cpu 0x%x isn't in xmon\n", cpu); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1169 return 0; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1170 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1171 xmon_taken = 0; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1172 mb(); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1173 xmon_owner = cpu; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1174 timeout = 10000000; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1175 while (!xmon_taken) { ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1176 if (--timeout == 0) { ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1177 if (test_and_set_bit(0, &xmon_taken)) ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1178 break; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1179 /* take control back */ ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1180 mb(); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1181 xmon_owner = smp_processor_id(); 736256e4f arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 1182 printf("cpu 0x%x didn't take control\n", cpu); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1183 return 0; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1184 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1185 barrier(); ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1186 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1187 return 1; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1188 #else ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1189 return 0; ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1190 #endif /* CONFIG_SMP */ ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1191 } ^1da177e4 arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 1192 :::::: The code at line 1168 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org> :::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 24150 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 01/19] xmon: Use __printf markup to silence compiler 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre 2018-03-17 23:33 ` kbuild test robot @ 2018-03-18 0:27 ` kbuild test robot 2018-03-25 9:06 ` [PATCH v2] " Mathieu Malaterre 2 siblings, 0 replies; 25+ messages in thread From: kbuild test robot @ 2018-03-18 0:27 UTC (permalink / raw) To: Mathieu Malaterre Cc: kbuild-all, Michael Ellerman, Mathieu Malaterre, Paul Mackerras, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 24420 bytes --] Hi Mathieu, Thank you for the patch! Yet something to improve: [auto build test ERROR on v4.16-rc4] [also build test ERROR on next-20180316] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Mathieu-Malaterre/Start-using-__printf-attribute-single-commit-series/20180318-035038 config: powerpc-currituck_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=powerpc All errors (new ones prefixed by >>): arch/powerpc/xmon/xmon.c: In function 'xmon_core': >> arch/powerpc/xmon/xmon.c:523:47: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Werror=format=] printf("cpu 0x%x stopped at breakpoint 0x%lx (", ~~^ %x arch/powerpc/xmon/xmon.c: In function 'cpu_cmd': arch/powerpc/xmon/xmon.c:1168:18: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("cpu 0x%x isn't in xmon\n", cpu); ~^ %lx arch/powerpc/xmon/xmon.c:1182:19: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("cpu 0x%x didn't take control\n", cpu); ~^ %lx arch/powerpc/xmon/xmon.c: In function 'bpt_cmds': arch/powerpc/xmon/xmon.c:1365:32: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Werror=format=] printf("Cleared breakpoint %lx (", BP_NUM(bp)); ~~^ %x arch/powerpc/xmon/xmon.c: In function 'excprint': arch/powerpc/xmon/xmon.c:1607:31: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'struct pt_regs *' [-Werror=format=] printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp); ~~^ arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [-Werror=format-extra-args] printf(" lr: ", fp->link); ^~~~~~~~~~ arch/powerpc/xmon/xmon.c:1623:26: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'struct task_struct *' [-Werror=format=] printf(" current = 0x%lx\n", current); ~~^ arch/powerpc/xmon/xmon.c:1629:25: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'pid_t {aka int}' [-Werror=format=] printf(" pid = %ld, comm = %s\n", ~~^ %d current->pid, current->comm); ~~~~~~~~~~~~ arch/powerpc/xmon/xmon.c: In function 'prregs': arch/powerpc/xmon/xmon.c:1674:22: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=] printf("R%.2d = %.8x%s", n, fp->gpr[n], ~~~^ ~~~~~~~~~~ %.8lx arch/powerpc/xmon/xmon.c: In function 'dump_by_size': arch/powerpc/xmon/xmon.c:2567:16: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'u64 {aka long long unsigned int}' [-Werror=format=] printf("%0*lx", size * 2, val); ~~~~^ %0*llx arch/powerpc/xmon/xmon.c: In function 'generic_inst_dump': arch/powerpc/xmon/xmon.c:197:14: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=] #define REG "%.8lx" ^ arch/powerpc/xmon/xmon.c:2731:11: note: in expansion of macro 'REG' printf(REG" %.8x", adr, inst); ^~~ arch/powerpc/xmon/xmon.c:2731:20: note: format string is defined here printf(REG" %.8x", adr, inst); ~~~^ %.8lx 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, ~~~~^ ~~~~~~ %.16hhn 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, ~~~~^ %.16hhn p1[-1], p2 - 1, p2[-1]); ~~~~~~ arch/powerpc/xmon/xmon.c: In function 'memzcan': arch/powerpc/xmon/xmon.c:2923:15: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("%.8x\n", a - mskip); ~~~^ ~~~~~~~~~ %.8lx arch/powerpc/xmon/xmon.c:2929:14: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("%.8x\n", a - mskip); ~~~^ ~~~~~~~~~ %.8lx arch/powerpc/xmon/xmon.c: In function 'dump_tlb_44x': arch/powerpc/xmon/xmon.c:3445:21: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=] printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); ~~~^ %08lx arch/powerpc/xmon/xmon.c:3445:26: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); ~~~^ %08lx arch/powerpc/xmon/xmon.c:3445:31: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Werror=format=] printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); ~~~^ %08lx arch/powerpc/xmon/xmon.c:3447:17: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Werror=format=] printf("V %08x -> %01x%08x %c%c%c%c%c", ~~~^ %08lx arch/powerpc/xmon/xmon.c:3447:25: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=] printf("V %08x -> %01x%08x %c%c%c%c%c", ~~~^ %01lx arch/powerpc/xmon/xmon.c:3447:29: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] printf("V %08x -> %01x%08x %c%c%c%c%c", ~~~^ %08lx cc1: all warnings being treated as errors vim +523 arch/powerpc/xmon/xmon.c ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 466 f13659e0 arch/powerpc/xmon/xmon.c Anton Blanchard 2007-03-21 467 local_irq_save(flags); a71d64b4 arch/powerpc/xmon/xmon.c Anton Blanchard 2014-08-05 468 hard_irq_disable(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 469 ed49f7fd arch/powerpc/xmon/xmon.c Breno Leitao 2017-08-02 470 tracing_enabled = tracing_is_on(); ed49f7fd arch/powerpc/xmon/xmon.c Breno Leitao 2017-08-02 471 tracing_off(); ed49f7fd arch/powerpc/xmon/xmon.c Breno Leitao 2017-08-02 472 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 473 bp = in_breakpoint_table(regs->nip, &offset); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 474 if (bp != NULL) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 475 regs->nip = bp->address + offset; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 476 atomic_dec(&bp->ref_count); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 477 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 478 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 479 remove_cpu_bpts(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 480 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 481 #ifdef CONFIG_SMP ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 482 cpu = smp_processor_id(); 104699c0 arch/powerpc/xmon/xmon.c KOSAKI Motohiro 2011-04-28 483 if (cpumask_test_cpu(cpu, &cpus_in_xmon)) { 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 484 /* 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 485 * We catch SPR read/write faults here because the 0x700, 0xf60 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 486 * etc. handlers don't call debugger_fault_handler(). 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 487 */ 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 488 if (catch_spr_faults) 31cdd0c3 arch/powerpc/xmon/xmon.c Paul Mackerras 2016-04-13 489 longjmp(bus_error_jmp, 1); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 490 get_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 491 excprint(regs); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 492 printf("cpu 0x%x: Exception %lx %s in xmon, " ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 493 "returning to main loop\n", ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 494 cpu, regs->trap, getvecname(TRAP(regs))); 5cb4cc0d arch/ppc64/xmon/xmon.c Haren Myneni 2005-08-03 495 release_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 496 longjmp(xmon_fault_jmp[cpu], 1); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 497 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 498 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 499 if (setjmp(recurse_jmp) != 0) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 500 if (!in_xmon || !xmon_gate) { 5cb4cc0d arch/ppc64/xmon/xmon.c Haren Myneni 2005-08-03 501 get_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 502 printf("xmon: WARNING: bad recursive fault " ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 503 "on cpu 0x%x\n", cpu); 5cb4cc0d arch/ppc64/xmon/xmon.c Haren Myneni 2005-08-03 504 release_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 505 goto waiting; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 506 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 507 secondary = !(xmon_taken && cpu == xmon_owner); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 508 goto cmdloop; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 509 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 510 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 511 xmon_fault_jmp[cpu] = recurse_jmp; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 512 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 513 bp = NULL; 9f0b0793 arch/powerpc/xmon/xmon.c Michael Ellerman 2011-04-07 514 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 515 bp = at_breakpoint(regs->nip); daf8f403 arch/powerpc/xmon/xmon.c Josh Boyer 2009-09-23 516 if (bp || unrecoverable_excp(regs)) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 517 fromipi = 0; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 518 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 519 if (!fromipi) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 520 get_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 521 excprint(regs); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 522 if (bp) { 736256e4 arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 @523 printf("cpu 0x%x stopped at breakpoint 0x%lx (", ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 524 cpu, BP_NUM(bp)); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 525 xmon_print_symbol(regs->nip, " ", ")\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 526 } daf8f403 arch/powerpc/xmon/xmon.c Josh Boyer 2009-09-23 527 if (unrecoverable_excp(regs)) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 528 printf("WARNING: exception is not recoverable, " ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 529 "can't continue\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 530 release_output_lock(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 531 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 532 d2b496e5 arch/powerpc/xmon/xmon.c Michael Ellerman 2013-12-23 533 cpumask_set_cpu(cpu, &cpus_in_xmon); d2b496e5 arch/powerpc/xmon/xmon.c Michael Ellerman 2013-12-23 534 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 535 waiting: ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 536 secondary = 1; 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 537 spin_begin(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 538 while (secondary && !xmon_gate) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 539 if (in_xmon == 0) { 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 540 if (fromipi) { 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 541 spin_end(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 542 goto leave; 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 543 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 544 secondary = test_and_set_bit(0, &in_xmon); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 545 } 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 546 spin_cpu_relax(); 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 547 touch_nmi_watchdog(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 548 } 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 549 spin_end(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 550 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 551 if (!secondary && !xmon_gate) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 552 /* we are the first cpu to come in */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 553 /* interrupt other cpu(s) */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 554 int ncpus = num_online_cpus(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 555 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 556 xmon_owner = cpu; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 557 mb(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 558 if (ncpus > 1) { 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 559 /* 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 560 * A system reset (trap == 0x100) can be triggered on 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 561 * all CPUs, so when we come in via 0x100 try waiting 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 562 * for the other CPUs to come in before we send the 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 563 * debugger break (IPI). This is similar to 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 564 * crash_kexec_secondary(). 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 565 */ 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 566 if (TRAP(regs) != 0x100 || !wait_for_other_cpus(ncpus)) e0476371 arch/powerpc/xmon/xmon.c Milton Miller 2011-05-10 567 smp_send_debugger_break(); 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 568 1cd6ed7c arch/powerpc/xmon/xmon.c Nicholas Piggin 2016-12-20 569 wait_for_other_cpus(ncpus); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 570 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 571 remove_bpts(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 572 disable_surveillance(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 573 /* for breakpoint or single step, print the current instr. */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 574 if (bp || TRAP(regs) == 0xd00) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 575 ppc_inst_dump(regs->nip, 1, 0); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 576 printf("enter ? for help\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 577 mb(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 578 xmon_gate = 1; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 579 barrier(); 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 580 touch_nmi_watchdog(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 581 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 582 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 583 cmdloop: ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 584 while (in_xmon) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 585 if (secondary) { 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 586 spin_begin(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 587 if (cpu == xmon_owner) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 588 if (!test_and_set_bit(0, &xmon_taken)) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 589 secondary = 0; 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 590 spin_end(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 591 continue; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 592 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 593 /* missed it */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 594 while (cpu == xmon_owner) 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 595 spin_cpu_relax(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 596 } 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 597 spin_cpu_relax(); 064996d6 arch/powerpc/xmon/xmon.c Nicholas Piggin 2017-09-29 598 touch_nmi_watchdog(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 599 } else { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 600 cmd = cmds(regs); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 601 if (cmd != 0) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 602 /* exiting xmon */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 603 insert_bpts(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 604 xmon_gate = 0; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 605 wmb(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 606 in_xmon = 0; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 607 break; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 608 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 609 /* have switched to some other cpu */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 610 secondary = 1; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 611 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 612 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 613 leave: 104699c0 arch/powerpc/xmon/xmon.c KOSAKI Motohiro 2011-04-28 614 cpumask_clear_cpu(cpu, &cpus_in_xmon); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 615 xmon_fault_jmp[cpu] = NULL; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 616 #else ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 617 /* UP is simple... */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 618 if (in_xmon) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 619 printf("Exception %lx %s in xmon, returning to main loop\n", ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 620 regs->trap, getvecname(TRAP(regs))); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 621 longjmp(xmon_fault_jmp[0], 1); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 622 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 623 if (setjmp(recurse_jmp) == 0) { ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 624 xmon_fault_jmp[0] = recurse_jmp; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 625 in_xmon = 1; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 626 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 627 excprint(regs); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 628 bp = at_breakpoint(regs->nip); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 629 if (bp) { 736256e4 arch/powerpc/xmon/xmon.c Michael Ellerman 2014-05-26 630 printf("Stopped at breakpoint %lx (", BP_NUM(bp)); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 631 xmon_print_symbol(regs->nip, " ", ")\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 632 } daf8f403 arch/powerpc/xmon/xmon.c Josh Boyer 2009-09-23 633 if (unrecoverable_excp(regs)) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 634 printf("WARNING: exception is not recoverable, " ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 635 "can't continue\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 636 remove_bpts(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 637 disable_surveillance(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 638 /* for breakpoint or single step, print the current instr. */ ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 639 if (bp || TRAP(regs) == 0xd00) ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 640 ppc_inst_dump(regs->nip, 1, 0); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 641 printf("enter ? for help\n"); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 642 } ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 643 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 644 cmd = cmds(regs); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 645 ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 646 insert_bpts(); ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 647 in_xmon = 0; ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 648 #endif ^1da177e arch/ppc64/xmon/xmon.c Linus Torvalds 2005-04-16 649 :::::: The code at line 523 was first introduced by commit :::::: 736256e4f1bc50bb8198c9b61dffd5fd0de17477 powerpc/xmon: Fix up xmon format strings :::::: TO: Michael Ellerman <mpe@ellerman.id.au> :::::: CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 15185 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2] xmon: Use __printf markup to silence compiler 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre 2018-03-17 23:33 ` kbuild test robot 2018-03-18 0:27 ` kbuild test robot @ 2018-03-25 9:06 ` Mathieu Malaterre 2018-04-24 18:55 ` Mathieu Malaterre 2018-05-25 11:41 ` [v2] " Michael Ellerman 2 siblings, 2 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-25 9:06 UTC (permalink / raw) To: Michael Ellerman Cc: Mathieu Malaterre, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel 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. Solve the original warning: arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] In turn this uncovered the following (partial list) warnings (treated as errors with W=1): arch/powerpc/xmon/xmon.c:2866:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘unsigned char *’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1607:31: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘struct pt_regs *’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [-Werror=format-extra-args] arch/powerpc/xmon/xmon.c:1623:26: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘struct task_struct *’ [-Werror=format=] arch/powerpc/xmon/xmon.c:630:36: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1392:15: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:2570:16: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1629:25: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘pid_t {aka int}’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1168:18: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:3016:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pgd_t * {aka struct <anonymous> *}’ [-Werror=format=] arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%p’ expects argument of type ‘void *’, but argument 4 has type ‘long long unsigned int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:3896:50: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] arch/powerpc/xmon/spu-dis.c:137:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] arch/powerpc/xmon/xmon.c:1665:17: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Werror=format=] arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with ‘%p’ gnu_printf format [-Werror=format=] Signed-off-by: Mathieu Malaterre <malat@debian.org> --- v2: resubmit patch series a single patch arch/powerpc/include/asm/xmon.h | 2 +- arch/powerpc/xmon/nonstdio.h | 8 +-- arch/powerpc/xmon/spu-dis.c | 18 +++--- arch/powerpc/xmon/xmon.c | 133 ++++++++++++++++++++-------------------- 4 files changed, 82 insertions(+), 79 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 */ diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 2202ec61972c..e8deac6c84e2 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h @@ -1,13 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0 */ #define EOF (-1) -#define printf xmon_printf -#define putchar xmon_putchar - extern void xmon_set_pagination_lpp(unsigned long lpp); extern void xmon_start_pagination(void); extern void xmon_end_pagination(void); extern int xmon_putchar(int c); extern void xmon_puts(const char *); extern char *xmon_gets(char *, int); -extern void xmon_printf(const char *, ...); +extern __printf(1, 2) void xmon_printf(const char *fmt, ...); + +#define printf xmon_printf +#define putchar xmon_putchar diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c index e5f89837c82e..4cbc7da88524 100644 --- a/arch/powerpc/xmon/spu-dis.c +++ b/arch/powerpc/xmon/spu-dis.c @@ -102,7 +102,7 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) if (index == 0) { - printf(".long 0x%x", insn); + printf(".long 0x%lx", insn); } else { @@ -134,27 +134,27 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) switch (arg) { case A_T: - printf("$%d", + printf("$%lu", DECODE_INSN_RT (insn)); break; case A_A: - printf("$%d", + printf("$%lu", DECODE_INSN_RA (insn)); break; case A_B: - printf("$%d", + printf("$%lu", DECODE_INSN_RB (insn)); break; case A_C: - printf("$%d", + printf("$%lu", DECODE_INSN_RC (insn)); break; case A_S: - printf("$sp%d", + printf("$sp%lu", DECODE_INSN_RA (insn)); break; case A_H: - printf("$ch%d", + printf("$ch%lu", DECODE_INSN_RA (insn)); break; case A_P: @@ -162,11 +162,11 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) printf("("); break; case A_U7A: - printf("%d", + printf("%lu", 173 - DECODE_INSN_U8 (insn)); break; case A_U7B: - printf("%d", + printf("%lu", 155 - DECODE_INSN_U8 (insn)); break; case A_S3: diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index ee113a6e008c..edd7ea85272f 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -627,7 +627,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) excprint(regs); bp = at_breakpoint(regs->nip); if (bp) { - printf("Stopped at breakpoint %lx (", BP_NUM(bp)); + printf("Stopped at breakpoint %tx (", BP_NUM(bp)); xmon_print_symbol(regs->nip, " ", ")\n"); } if (unrecoverable_excp(regs)) @@ -1165,7 +1165,7 @@ static int cpu_cmd(void) } /* try to switch to cpu specified */ if (!cpumask_test_cpu(cpu, &cpus_in_xmon)) { - printf("cpu 0x%x isn't in xmon\n", cpu); + printf("cpu 0x%lx isn't in xmon\n", cpu); return 0; } xmon_taken = 0; @@ -1179,7 +1179,7 @@ static int cpu_cmd(void) /* take control back */ mb(); xmon_owner = smp_processor_id(); - printf("cpu 0x%x didn't take control\n", cpu); + printf("cpu 0x%lx didn't take control\n", cpu); return 0; } barrier(); @@ -1362,7 +1362,7 @@ bpt_cmds(void) } } - printf("Cleared breakpoint %lx (", BP_NUM(bp)); + printf("Cleared breakpoint %tx (", BP_NUM(bp)); xmon_print_symbol(bp->address, " ", ")\n"); bp->enabled = 0; break; @@ -1389,7 +1389,7 @@ bpt_cmds(void) for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { if (!bp->enabled) continue; - printf("%2x %s ", BP_NUM(bp), + printf("%tx %s ", BP_NUM(bp), (bp->enabled & BP_CIABR) ? "inst": "trap"); xmon_print_symbol(bp->address, " ", "\n"); } @@ -1604,11 +1604,11 @@ static void excprint(struct pt_regs *fp) #endif /* CONFIG_SMP */ trap = TRAP(fp); - printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp); + printf("Vector: %lx %s at [%p]\n", fp->trap, getvecname(trap), fp); printf(" pc: "); xmon_print_symbol(fp->nip, ": ", "\n"); - printf(" lr: ", fp->link); + printf(" lr: "); xmon_print_symbol(fp->link, ": ", "\n"); printf(" sp: %lx\n", fp->gpr[1]); @@ -1620,13 +1620,13 @@ static void excprint(struct pt_regs *fp) printf(" dsisr: %lx\n", fp->dsisr); } - printf(" current = 0x%lx\n", current); + printf(" current = 0x%p\n", current); #ifdef CONFIG_PPC64 - printf(" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n", + printf(" paca = 0x%p\t softe: %d\t irq_happened: 0x%02x\n", local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); #endif if (current) { - printf(" pid = %ld, comm = %s\n", + printf(" pid = %d, comm = %s\n", current->pid, current->comm); } @@ -1662,16 +1662,16 @@ static void prregs(struct pt_regs *fp) #ifdef CONFIG_PPC64 if (FULL_REGS(fp)) { for (n = 0; n < 16; ++n) - printf("R%.2ld = "REG" R%.2ld = "REG"\n", + printf("R%.2d = "REG" R%.2d = "REG"\n", n, fp->gpr[n], n+16, fp->gpr[n+16]); } else { for (n = 0; n < 7; ++n) - printf("R%.2ld = "REG" R%.2ld = "REG"\n", + printf("R%.2d = "REG" R%.2d = "REG"\n", n, fp->gpr[n], n+7, fp->gpr[n+7]); } #else for (n = 0; n < 32; ++n) { - printf("R%.2d = %.8x%s", n, fp->gpr[n], + printf("R%.2d = %.8lx%s", n, fp->gpr[n], (n & 3) == 3? "\n": " "); if (n == 12 && !FULL_REGS(fp)) { printf("\n"); @@ -1775,9 +1775,9 @@ static void dump_206_sprs(void) /* Actually some of these pre-date 2.06, but whatevs */ - printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8x\n", + printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8lx\n", mfspr(SPRN_SRR0), mfspr(SPRN_SRR1), mfspr(SPRN_DSISR)); - printf("dscr = %.16lx ppr = %.16lx pir = %.8x\n", + printf("dscr = %.16lx ppr = %.16lx pir = %.8lx\n", mfspr(SPRN_DSCR), mfspr(SPRN_PPR), mfspr(SPRN_PIR)); printf("amr = %.16lx uamor = %.16lx\n", mfspr(SPRN_AMR), mfspr(SPRN_UAMOR)); @@ -1785,11 +1785,11 @@ static void dump_206_sprs(void) if (!(mfmsr() & MSR_HV)) return; - printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8x\n", + printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8lx\n", mfspr(SPRN_SDR1), mfspr(SPRN_HDAR), mfspr(SPRN_HDSISR)); printf("hsrr0 = %.16lx hsrr1 = %.16lx hdec = %.16lx\n", mfspr(SPRN_HSRR0), mfspr(SPRN_HSRR1), mfspr(SPRN_HDEC)); - printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8x\n", + printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8lx\n", mfspr(SPRN_LPCR), mfspr(SPRN_PCR), mfspr(SPRN_LPID)); printf("hsprg0 = %.16lx hsprg1 = %.16lx amor = %.16lx\n", mfspr(SPRN_HSPRG0), mfspr(SPRN_HSPRG1), mfspr(SPRN_AMOR)); @@ -1806,10 +1806,10 @@ static void dump_207_sprs(void) if (!cpu_has_feature(CPU_FTR_ARCH_207S)) return; - printf("dpdes = %.16lx tir = %.16lx cir = %.8x\n", + printf("dpdes = %.16lx tir = %.16lx cir = %.8lx\n", mfspr(SPRN_DPDES), mfspr(SPRN_TIR), mfspr(SPRN_CIR)); - printf("fscr = %.16lx tar = %.16lx pspb = %.8x\n", + printf("fscr = %.16lx tar = %.16lx pspb = %.8lx\n", mfspr(SPRN_FSCR), mfspr(SPRN_TAR), mfspr(SPRN_PSPB)); msr = mfmsr(); @@ -1822,12 +1822,12 @@ static void dump_207_sprs(void) printf("mmcr0 = %.16lx mmcr1 = %.16lx mmcr2 = %.16lx\n", mfspr(SPRN_MMCR0), mfspr(SPRN_MMCR1), mfspr(SPRN_MMCR2)); - printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", + printf("pmc1 = %.8lx pmc2 = %.8lx pmc3 = %.8lx pmc4 = %.8lx\n", mfspr(SPRN_PMC1), mfspr(SPRN_PMC2), mfspr(SPRN_PMC3), mfspr(SPRN_PMC4)); - printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8x\n", + printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8lx\n", mfspr(SPRN_MMCRA), mfspr(SPRN_SIAR), mfspr(SPRN_PMC5)); - printf("sdar = %.16lx sier = %.16lx pmc6 = %.8x\n", + printf("sdar = %.16lx sier = %.16lx pmc6 = %.8lx\n", mfspr(SPRN_SDAR), mfspr(SPRN_SIER), mfspr(SPRN_PMC6)); printf("ebbhr = %.16lx ebbrr = %.16lx bescr = %.16lx\n", mfspr(SPRN_EBBHR), mfspr(SPRN_EBBRR), mfspr(SPRN_BESCR)); @@ -2337,22 +2337,25 @@ static void dump_one_paca(int cpu) #define DUMP(paca, name, format) \ printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ - offsetof(struct paca_struct, name)); + offsetof(struct paca_struct, name)) +#define DUMPPTR(paca, name, format) \ + printf(" %-*s = %-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ + offsetof(struct paca_struct, name)) DUMP(p, lock_token, "x"); DUMP(p, paca_index, "x"); - DUMP(p, kernel_toc, "lx"); - DUMP(p, kernelbase, "lx"); - DUMP(p, kernel_msr, "lx"); - DUMP(p, emergency_sp, "px"); + DUMP(p, kernel_toc, "llx"); + DUMP(p, kernelbase, "llx"); + DUMP(p, kernel_msr, "llx"); + DUMPPTR(p, emergency_sp, "p"); #ifdef CONFIG_PPC_BOOK3S_64 - DUMP(p, nmi_emergency_sp, "px"); - DUMP(p, mc_emergency_sp, "px"); + DUMPPTR(p, nmi_emergency_sp, "p"); + DUMPPTR(p, mc_emergency_sp, "p"); DUMP(p, in_nmi, "x"); DUMP(p, in_mce, "x"); DUMP(p, hmi_event_available, "x"); #endif - DUMP(p, data_offset, "lx"); + DUMP(p, data_offset, "llx"); DUMP(p, hw_cpu_id, "x"); DUMP(p, cpu_start, "x"); DUMP(p, kexec_state, "x"); @@ -2367,16 +2370,16 @@ static void dump_one_paca(int cpu) vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); if (esid || vsid) { - printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", + printf(" slb_shadow[%d]: = 0x%016llx 0x%016llx\n", i, esid, vsid); } } DUMP(p, vmalloc_sllp, "x"); DUMP(p, slb_cache_ptr, "x"); for (i = 0; i < SLB_CACHE_ENTRIES; i++) - printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); + printf(" slb_cache[%d]: = 0x%016x\n", i, p->slb_cache[i]); - DUMP(p, rfi_flush_fallback_area, "px"); + DUMPPTR(p, rfi_flush_fallback_area, "p"); #endif DUMP(p, dscr_default, "llx"); #ifdef CONFIG_PPC_BOOK3E @@ -2387,11 +2390,11 @@ static void dump_one_paca(int cpu) DUMP(p, crit_kstack, "px"); DUMP(p, dbg_kstack, "px"); #endif - DUMP(p, __current, "px"); - DUMP(p, kstack, "lx"); - printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); - DUMP(p, stab_rr, "lx"); - DUMP(p, saved_r1, "lx"); + DUMPPTR(p, __current, "p"); + DUMP(p, kstack, "llx"); + printf(" kstack_base = 0x%016llx\n", p->kstack & ~(THREAD_SIZE - 1)); + DUMP(p, stab_rr, "llx"); + DUMP(p, saved_r1, "llx"); DUMP(p, trap_save, "x"); DUMP(p, irq_soft_mask, "x"); DUMP(p, irq_happened, "x"); @@ -2405,20 +2408,20 @@ static void dump_one_paca(int cpu) #endif #ifdef CONFIG_PPC_POWERNV - DUMP(p, core_idle_state_ptr, "px"); + DUMPPTR(p, core_idle_state_ptr, "p"); DUMP(p, thread_idle_state, "x"); DUMP(p, thread_mask, "x"); DUMP(p, subcore_sibling_mask, "x"); #endif - DUMP(p, accounting.utime, "llx"); - DUMP(p, accounting.stime, "llx"); - DUMP(p, accounting.utime_scaled, "llx"); - DUMP(p, accounting.starttime, "llx"); - DUMP(p, accounting.starttime_user, "llx"); - DUMP(p, accounting.startspurr, "llx"); - DUMP(p, accounting.utime_sspurr, "llx"); - DUMP(p, accounting.steal_time, "llx"); + DUMP(p, accounting.utime, "lx"); + DUMP(p, accounting.stime, "lx"); + DUMP(p, accounting.utime_scaled, "lx"); + DUMP(p, accounting.starttime, "lx"); + DUMP(p, accounting.starttime_user, "lx"); + DUMP(p, accounting.startspurr, "lx"); + DUMP(p, accounting.utime_sspurr, "lx"); + DUMP(p, accounting.steal_time, "lx"); #undef DUMP catch_memory_errors = 0; @@ -2564,7 +2567,7 @@ static void dump_by_size(unsigned long addr, long count, int size) default: val = 0; } - printf("%0*lx", size * 2, val); + printf("%0*llx", size * 2, val); } printf("\n"); } @@ -2728,7 +2731,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr, dotted = 0; last_inst = inst; if (praddr) - printf(REG" %.8x", adr, inst); + printf(REG" %.8lx", adr, inst); printf("\t"); dump_func(inst, adr); printf("\n"); @@ -2860,7 +2863,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); @@ -2920,13 +2923,13 @@ memzcan(void) if (ok && !ook) { printf("%.8x .. ", a); } else if (!ok && ook) - printf("%.8x\n", a - mskip); + printf("%.8lx\n", a - mskip); ook = ok; if (a + mskip < a) break; } if (ook) - printf("%.8x\n", a - mskip); + printf("%.8lx\n", a - mskip); } static void show_task(struct task_struct *tsk) @@ -3010,13 +3013,13 @@ static void show_pte(unsigned long addr) return; } - printf("pgd @ 0x%016lx\n", pgdir); + printf("pgd @ 0x%p\n", pgdir); if (pgd_huge(*pgdp)) { format_pte(pgdp, pgd_val(*pgdp)); return; } - printf("pgdp @ 0x%016lx = 0x%016lx\n", pgdp, pgd_val(*pgdp)); + printf("pgdp @ 0x%p = 0x%016lx\n", pgdp, pgd_val(*pgdp)); pudp = pud_offset(pgdp, addr); @@ -3030,7 +3033,7 @@ static void show_pte(unsigned long addr) return; } - printf("pudp @ 0x%016lx = 0x%016lx\n", pudp, pud_val(*pudp)); + printf("pudp @ 0x%p = 0x%016lx\n", pudp, pud_val(*pudp)); pmdp = pmd_offset(pudp, addr); @@ -3043,7 +3046,7 @@ static void show_pte(unsigned long addr) format_pte(pmdp, pmd_val(*pmdp)); return; } - printf("pmdp @ 0x%016lx = 0x%016lx\n", pmdp, pmd_val(*pmdp)); + printf("pmdp @ 0x%p = 0x%016lx\n", pmdp, pmd_val(*pmdp)); ptep = pte_offset_map(pmdp, addr); if (pte_none(*ptep)) { @@ -3847,19 +3850,19 @@ static void dump_spu_fields(struct spu *spu) DUMP_FIELD(spu, "0x%lx", ls_size); DUMP_FIELD(spu, "0x%x", node); DUMP_FIELD(spu, "0x%lx", flags); - DUMP_FIELD(spu, "%d", class_0_pending); - DUMP_FIELD(spu, "0x%lx", class_0_dar); - DUMP_FIELD(spu, "0x%lx", class_1_dar); - DUMP_FIELD(spu, "0x%lx", class_1_dsisr); - DUMP_FIELD(spu, "0x%lx", irqs[0]); - DUMP_FIELD(spu, "0x%lx", irqs[1]); - DUMP_FIELD(spu, "0x%lx", irqs[2]); + DUMP_FIELD(spu, "%llu", class_0_pending); + DUMP_FIELD(spu, "0x%llx", class_0_dar); + DUMP_FIELD(spu, "0x%llx", class_1_dar); + DUMP_FIELD(spu, "0x%llx", class_1_dsisr); + DUMP_FIELD(spu, "0x%x", irqs[0]); + DUMP_FIELD(spu, "0x%x", irqs[1]); + DUMP_FIELD(spu, "0x%x", irqs[2]); DUMP_FIELD(spu, "0x%x", slb_replace); DUMP_FIELD(spu, "%d", pid); DUMP_FIELD(spu, "0x%p", mm); DUMP_FIELD(spu, "0x%p", ctx); DUMP_FIELD(spu, "0x%p", rq); - DUMP_FIELD(spu, "0x%p", timestamp); + DUMP_FIELD(spu, "0x%llx", timestamp); DUMP_FIELD(spu, "0x%lx", problem_phys); DUMP_FIELD(spu, "0x%p", problem); DUMP_VALUE("0x%x", problem->spu_runcntl_RW, @@ -3890,7 +3893,7 @@ static void dump_spu_ls(unsigned long num, int subcmd) __delay(200); } else { catch_memory_errors = 0; - printf("*** Error: accessing spu info for spu %d\n", num); + printf("*** Error: accessing spu info for spu %ld\n", num); return; } catch_memory_errors = 0; -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v2] xmon: Use __printf markup to silence compiler 2018-03-25 9:06 ` [PATCH v2] " Mathieu Malaterre @ 2018-04-24 18:55 ` Mathieu Malaterre 2018-05-25 11:41 ` [v2] " Michael Ellerman 1 sibling, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-04-24 18:55 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, LKML No comment so far... Did I miss anything ? On Sun, Mar 25, 2018 at 11:06 AM, Mathieu Malaterre <malat@debian.org> wrot= e: > Update the other prototype declarations in asm/xmon.h. > > Silence warnings (triggered at W=3D1) by adding relevant __printf attribu= te. > Move #define at bottom of the file to prevent conflict with gcc attribute= . > > Solve the original warning: > > arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible c= andidate for =E2=80=98gnu_printf=E2=80=99 format attribute [-Werror=3Dsugge= st-attribute=3Dformat] > > In turn this uncovered the following (partial list) warnings (treated as > errors with W=3D1): > > arch/powerpc/xmon/xmon.c:2866:17: error: format =E2=80=98%x=E2=80=99 ex= pects argument of type =E2=80=98unsigned int=E2=80=99, but argument 2 has t= ype =E2=80=98unsigned char *=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:1607:31: error: format =E2=80=98%lx=E2=80=99 e= xpects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 4= has type =E2=80=98struct pt_regs *=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [= -Werror=3Dformat-extra-args] > arch/powerpc/xmon/xmon.c:1623:26: error: format =E2=80=98%lx=E2=80=99 e= xpects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 2= has type =E2=80=98struct task_struct *=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:630:36: error: format =E2=80=98%lx=E2=80=99 ex= pects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 2 = has type =E2=80=98int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:1392:15: error: format =E2=80=98%x=E2=80=99 ex= pects argument of type =E2=80=98unsigned int=E2=80=99, but argument 2 has t= ype =E2=80=98long int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:2570:16: error: format =E2=80=98%lx=E2=80=99 e= xpects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 3= has type =E2=80=98u64 {aka long long unsigned int}=E2=80=99 [-Werror=3Dfor= mat=3D] > arch/powerpc/xmon/xmon.c:1629:25: error: format =E2=80=98%ld=E2=80=99 e= xpects argument of type =E2=80=98long int=E2=80=99, but argument 2 has type= =E2=80=98pid_t {aka int}=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:1168:18: error: format =E2=80=98%x=E2=80=99 ex= pects argument of type =E2=80=98unsigned int=E2=80=99, but argument 2 has t= ype =E2=80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:3016:24: error: format =E2=80=98%lx=E2=80=99 e= xpects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 2= has type =E2=80=98pgd_t * {aka struct <anonymous> *}=E2=80=99 [-Werror=3Df= ormat=3D] > arch/powerpc/xmon/xmon.c:2339:9: error: format =E2=80=98%lx=E2=80=99 ex= pects argument of type =E2=80=98long unsigned int=E2=80=99, but argument 5 = has type =E2=80=98u64 {aka long long unsigned int}=E2=80=99 [-Werror=3Dform= at=3D] > arch/powerpc/xmon/xmon.c:2339:9: error: format =E2=80=98%llx=E2=80=99 e= xpects argument of type =E2=80=98long long unsigned int=E2=80=99, but argum= ent 5 has type =E2=80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:3827:10: error: format =E2=80=98%p=E2=80=99 ex= pects argument of type =E2=80=98void *=E2=80=99, but argument 4 has type = =E2=80=98long long unsigned int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:3896:50: error: format =E2=80=98%d=E2=80=99 ex= pects argument of type =E2=80=98int=E2=80=99, but argument 2 has type =E2= =80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/spu-dis.c:137:18: error: format =E2=80=98%d=E2=80=99 = expects argument of type =E2=80=98int=E2=80=99, but argument 2 has type =E2= =80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:3827:10: error: format =E2=80=98%d=E2=80=99 ex= pects argument of type =E2=80=98int=E2=80=99, but argument 4 has type =E2= =80=98u64 {aka long long unsigned int}=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:1665:17: error: format =E2=80=98%ld=E2=80=99 e= xpects argument of type =E2=80=98long int=E2=80=99, but argument 2 has type= =E2=80=98int=E2=80=99 [-Werror=3Dformat=3D] > arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with =E2=80=98%p= =E2=80=99 gnu_printf format [-Werror=3Dformat=3D] > > Signed-off-by: Mathieu Malaterre <malat@debian.org> > --- > v2: resubmit patch series a single patch > > arch/powerpc/include/asm/xmon.h | 2 +- > arch/powerpc/xmon/nonstdio.h | 8 +-- > arch/powerpc/xmon/spu-dis.c | 18 +++--- > arch/powerpc/xmon/xmon.c | 133 ++++++++++++++++++++--------------= ------ > 4 files changed, 82 insertions(+), 79 deletions(-) > > diff --git a/arch/powerpc/include/asm/xmon.h b/arch/powerpc/include/asm/x= mon.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 */ > diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h > index 2202ec61972c..e8deac6c84e2 100644 > --- a/arch/powerpc/xmon/nonstdio.h > +++ b/arch/powerpc/xmon/nonstdio.h > @@ -1,13 +1,13 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > #define EOF (-1) > > -#define printf xmon_printf > -#define putchar xmon_putchar > - > extern void xmon_set_pagination_lpp(unsigned long lpp); > extern void xmon_start_pagination(void); > extern void xmon_end_pagination(void); > extern int xmon_putchar(int c); > extern void xmon_puts(const char *); > extern char *xmon_gets(char *, int); > -extern void xmon_printf(const char *, ...); > +extern __printf(1, 2) void xmon_printf(const char *fmt, ...); > + > +#define printf xmon_printf > +#define putchar xmon_putchar > diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c > index e5f89837c82e..4cbc7da88524 100644 > --- a/arch/powerpc/xmon/spu-dis.c > +++ b/arch/powerpc/xmon/spu-dis.c > @@ -102,7 +102,7 @@ print_insn_spu (unsigned long insn, unsigned long mem= addr) > > if (index =3D=3D 0) > { > - printf(".long 0x%x", insn); > + printf(".long 0x%lx", insn); > } > else > { > @@ -134,27 +134,27 @@ print_insn_spu (unsigned long insn, unsigned long m= emaddr) > switch (arg) > { > case A_T: > - printf("$%d", > + printf("$%lu", > DECODE_INSN_RT (insn)); > break; > case A_A: > - printf("$%d", > + printf("$%lu", > DECODE_INSN_RA (insn)); > break; > case A_B: > - printf("$%d", > + printf("$%lu", > DECODE_INSN_RB (insn)); > break; > case A_C: > - printf("$%d", > + printf("$%lu", > DECODE_INSN_RC (insn)); > break; > case A_S: > - printf("$sp%d", > + printf("$sp%lu", > DECODE_INSN_RA (insn)); > break; > case A_H: > - printf("$ch%d", > + printf("$ch%lu", > DECODE_INSN_RA (insn)); > break; > case A_P: > @@ -162,11 +162,11 @@ print_insn_spu (unsigned long insn, unsigned long m= emaddr) > printf("("); > break; > case A_U7A: > - printf("%d", > + printf("%lu", > 173 - DECODE_INSN_U8 (insn)); > break; > case A_U7B: > - printf("%d", > + printf("%lu", > 155 - DECODE_INSN_U8 (insn)); > break; > case A_S3: > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c > index ee113a6e008c..edd7ea85272f 100644 > --- a/arch/powerpc/xmon/xmon.c > +++ b/arch/powerpc/xmon/xmon.c > @@ -627,7 +627,7 @@ static int xmon_core(struct pt_regs *regs, int fromip= i) > excprint(regs); > bp =3D at_breakpoint(regs->nip); > if (bp) { > - printf("Stopped at breakpoint %lx (", BP_NUM(bp))= ; > + printf("Stopped at breakpoint %tx (", BP_NUM(bp))= ; > xmon_print_symbol(regs->nip, " ", ")\n"); > } > if (unrecoverable_excp(regs)) > @@ -1165,7 +1165,7 @@ static int cpu_cmd(void) > } > /* try to switch to cpu specified */ > if (!cpumask_test_cpu(cpu, &cpus_in_xmon)) { > - printf("cpu 0x%x isn't in xmon\n", cpu); > + printf("cpu 0x%lx isn't in xmon\n", cpu); > return 0; > } > xmon_taken =3D 0; > @@ -1179,7 +1179,7 @@ static int cpu_cmd(void) > /* take control back */ > mb(); > xmon_owner =3D smp_processor_id(); > - printf("cpu 0x%x didn't take control\n", cpu); > + printf("cpu 0x%lx didn't take control\n", cpu); > return 0; > } > barrier(); > @@ -1362,7 +1362,7 @@ bpt_cmds(void) > } > } > > - printf("Cleared breakpoint %lx (", BP_NUM(bp)); > + printf("Cleared breakpoint %tx (", BP_NUM(bp)); > xmon_print_symbol(bp->address, " ", ")\n"); > bp->enabled =3D 0; > break; > @@ -1389,7 +1389,7 @@ bpt_cmds(void) > for (bp =3D bpts; bp < &bpts[NBPTS]; ++bp) { > if (!bp->enabled) > continue; > - printf("%2x %s ", BP_NUM(bp), > + printf("%tx %s ", BP_NUM(bp), > (bp->enabled & BP_CIABR) ? "inst": "t= rap"); > xmon_print_symbol(bp->address, " ", "\n"= ); > } > @@ -1604,11 +1604,11 @@ static void excprint(struct pt_regs *fp) > #endif /* CONFIG_SMP */ > > trap =3D TRAP(fp); > - printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), f= p); > + printf("Vector: %lx %s at [%p]\n", fp->trap, getvecname(trap), fp= ); > printf(" pc: "); > xmon_print_symbol(fp->nip, ": ", "\n"); > > - printf(" lr: ", fp->link); > + printf(" lr: "); > xmon_print_symbol(fp->link, ": ", "\n"); > > printf(" sp: %lx\n", fp->gpr[1]); > @@ -1620,13 +1620,13 @@ static void excprint(struct pt_regs *fp) > printf(" dsisr: %lx\n", fp->dsisr); > } > > - printf(" current =3D 0x%lx\n", current); > + printf(" current =3D 0x%p\n", current); > #ifdef CONFIG_PPC64 > - printf(" paca =3D 0x%lx\t softe: %d\t irq_happened: 0x%02x\n"= , > + printf(" paca =3D 0x%p\t softe: %d\t irq_happened: 0x%02x\n", > local_paca, local_paca->irq_soft_mask, local_paca->irq_hap= pened); > #endif > if (current) { > - printf(" pid =3D %ld, comm =3D %s\n", > + printf(" pid =3D %d, comm =3D %s\n", > current->pid, current->comm); > } > > @@ -1662,16 +1662,16 @@ static void prregs(struct pt_regs *fp) > #ifdef CONFIG_PPC64 > if (FULL_REGS(fp)) { > for (n =3D 0; n < 16; ++n) > - printf("R%.2ld =3D "REG" R%.2ld =3D "REG"\n", > + printf("R%.2d =3D "REG" R%.2d =3D "REG"\n", > n, fp->gpr[n], n+16, fp->gpr[n+16]); > } else { > for (n =3D 0; n < 7; ++n) > - printf("R%.2ld =3D "REG" R%.2ld =3D "REG"\n", > + printf("R%.2d =3D "REG" R%.2d =3D "REG"\n", > n, fp->gpr[n], n+7, fp->gpr[n+7]); > } > #else > for (n =3D 0; n < 32; ++n) { > - printf("R%.2d =3D %.8x%s", n, fp->gpr[n], > + printf("R%.2d =3D %.8lx%s", n, fp->gpr[n], > (n & 3) =3D=3D 3? "\n": " "); > if (n =3D=3D 12 && !FULL_REGS(fp)) { > printf("\n"); > @@ -1775,9 +1775,9 @@ static void dump_206_sprs(void) > > /* Actually some of these pre-date 2.06, but whatevs */ > > - printf("srr0 =3D %.16lx srr1 =3D %.16lx dsisr =3D %.8x\n", > + printf("srr0 =3D %.16lx srr1 =3D %.16lx dsisr =3D %.8lx\n", > mfspr(SPRN_SRR0), mfspr(SPRN_SRR1), mfspr(SPRN_DSISR)); > - printf("dscr =3D %.16lx ppr =3D %.16lx pir =3D %.8x\n", > + printf("dscr =3D %.16lx ppr =3D %.16lx pir =3D %.8lx\n", > mfspr(SPRN_DSCR), mfspr(SPRN_PPR), mfspr(SPRN_PIR)); > printf("amr =3D %.16lx uamor =3D %.16lx\n", > mfspr(SPRN_AMR), mfspr(SPRN_UAMOR)); > @@ -1785,11 +1785,11 @@ static void dump_206_sprs(void) > if (!(mfmsr() & MSR_HV)) > return; > > - printf("sdr1 =3D %.16lx hdar =3D %.16lx hdsisr =3D %.8x\n", > + printf("sdr1 =3D %.16lx hdar =3D %.16lx hdsisr =3D %.8lx\n", > mfspr(SPRN_SDR1), mfspr(SPRN_HDAR), mfspr(SPRN_HDSISR)); > printf("hsrr0 =3D %.16lx hsrr1 =3D %.16lx hdec =3D %.16lx\n", > mfspr(SPRN_HSRR0), mfspr(SPRN_HSRR1), mfspr(SPRN_HDEC)); > - printf("lpcr =3D %.16lx pcr =3D %.16lx lpidr =3D %.8x\n", > + printf("lpcr =3D %.16lx pcr =3D %.16lx lpidr =3D %.8lx\n", > mfspr(SPRN_LPCR), mfspr(SPRN_PCR), mfspr(SPRN_LPID)); > printf("hsprg0 =3D %.16lx hsprg1 =3D %.16lx amor =3D %.16lx\n", > mfspr(SPRN_HSPRG0), mfspr(SPRN_HSPRG1), mfspr(SPRN_AMOR))= ; > @@ -1806,10 +1806,10 @@ static void dump_207_sprs(void) > if (!cpu_has_feature(CPU_FTR_ARCH_207S)) > return; > > - printf("dpdes =3D %.16lx tir =3D %.16lx cir =3D %.8x\n", > + printf("dpdes =3D %.16lx tir =3D %.16lx cir =3D %.8lx\n", > mfspr(SPRN_DPDES), mfspr(SPRN_TIR), mfspr(SPRN_CIR)); > > - printf("fscr =3D %.16lx tar =3D %.16lx pspb =3D %.8x\n", > + printf("fscr =3D %.16lx tar =3D %.16lx pspb =3D %.8lx\n", > mfspr(SPRN_FSCR), mfspr(SPRN_TAR), mfspr(SPRN_PSPB)); > > msr =3D mfmsr(); > @@ -1822,12 +1822,12 @@ static void dump_207_sprs(void) > > printf("mmcr0 =3D %.16lx mmcr1 =3D %.16lx mmcr2 =3D %.16lx\n", > mfspr(SPRN_MMCR0), mfspr(SPRN_MMCR1), mfspr(SPRN_MMCR2)); > - printf("pmc1 =3D %.8x pmc2 =3D %.8x pmc3 =3D %.8x pmc4 =3D = %.8x\n", > + printf("pmc1 =3D %.8lx pmc2 =3D %.8lx pmc3 =3D %.8lx pmc4 = =3D %.8lx\n", > mfspr(SPRN_PMC1), mfspr(SPRN_PMC2), > mfspr(SPRN_PMC3), mfspr(SPRN_PMC4)); > - printf("mmcra =3D %.16lx siar =3D %.16lx pmc5 =3D %.8x\n", > + printf("mmcra =3D %.16lx siar =3D %.16lx pmc5 =3D %.8lx\n", > mfspr(SPRN_MMCRA), mfspr(SPRN_SIAR), mfspr(SPRN_PMC5)); > - printf("sdar =3D %.16lx sier =3D %.16lx pmc6 =3D %.8x\n", > + printf("sdar =3D %.16lx sier =3D %.16lx pmc6 =3D %.8lx\n", > mfspr(SPRN_SDAR), mfspr(SPRN_SIER), mfspr(SPRN_PMC6)); > printf("ebbhr =3D %.16lx ebbrr =3D %.16lx bescr =3D %.16lx\n", > mfspr(SPRN_EBBHR), mfspr(SPRN_EBBRR), mfspr(SPRN_BESCR)); > @@ -2337,22 +2337,25 @@ static void dump_one_paca(int cpu) > > #define DUMP(paca, name, format) \ > printf(" %-*s =3D %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->= name, \ > - offsetof(struct paca_struct, name)); > + offsetof(struct paca_struct, name)) > +#define DUMPPTR(paca, name, format) \ > + printf(" %-*s =3D %-*"format"\t(0x%lx)\n", 20, #name, 18, paca->n= ame, \ > + offsetof(struct paca_struct, name)) > > DUMP(p, lock_token, "x"); > DUMP(p, paca_index, "x"); > - DUMP(p, kernel_toc, "lx"); > - DUMP(p, kernelbase, "lx"); > - DUMP(p, kernel_msr, "lx"); > - DUMP(p, emergency_sp, "px"); > + DUMP(p, kernel_toc, "llx"); > + DUMP(p, kernelbase, "llx"); > + DUMP(p, kernel_msr, "llx"); > + DUMPPTR(p, emergency_sp, "p"); > #ifdef CONFIG_PPC_BOOK3S_64 > - DUMP(p, nmi_emergency_sp, "px"); > - DUMP(p, mc_emergency_sp, "px"); > + DUMPPTR(p, nmi_emergency_sp, "p"); > + DUMPPTR(p, mc_emergency_sp, "p"); > DUMP(p, in_nmi, "x"); > DUMP(p, in_mce, "x"); > DUMP(p, hmi_event_available, "x"); > #endif > - DUMP(p, data_offset, "lx"); > + DUMP(p, data_offset, "llx"); > DUMP(p, hw_cpu_id, "x"); > DUMP(p, cpu_start, "x"); > DUMP(p, kexec_state, "x"); > @@ -2367,16 +2370,16 @@ static void dump_one_paca(int cpu) > vsid =3D be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid= ); > > if (esid || vsid) { > - printf(" slb_shadow[%d]: =3D 0x%016lx 0x%01= 6lx\n", > + printf(" slb_shadow[%d]: =3D 0x%016llx 0x%0= 16llx\n", > i, esid, vsid); > } > } > DUMP(p, vmalloc_sllp, "x"); > DUMP(p, slb_cache_ptr, "x"); > for (i =3D 0; i < SLB_CACHE_ENTRIES; i++) > - printf(" slb_cache[%d]: =3D 0x%016lx\n", i, p->slb= _cache[i]); > + printf(" slb_cache[%d]: =3D 0x%016x\n", i, p->slb_= cache[i]); > > - DUMP(p, rfi_flush_fallback_area, "px"); > + DUMPPTR(p, rfi_flush_fallback_area, "p"); > #endif > DUMP(p, dscr_default, "llx"); > #ifdef CONFIG_PPC_BOOK3E > @@ -2387,11 +2390,11 @@ static void dump_one_paca(int cpu) > DUMP(p, crit_kstack, "px"); > DUMP(p, dbg_kstack, "px"); > #endif > - DUMP(p, __current, "px"); > - DUMP(p, kstack, "lx"); > - printf(" kstack_base =3D 0x%016lx\n", p->kstack & ~(THRE= AD_SIZE - 1)); > - DUMP(p, stab_rr, "lx"); > - DUMP(p, saved_r1, "lx"); > + DUMPPTR(p, __current, "p"); > + DUMP(p, kstack, "llx"); > + printf(" kstack_base =3D 0x%016llx\n", p->kstack & ~(THR= EAD_SIZE - 1)); > + DUMP(p, stab_rr, "llx"); > + DUMP(p, saved_r1, "llx"); > DUMP(p, trap_save, "x"); > DUMP(p, irq_soft_mask, "x"); > DUMP(p, irq_happened, "x"); > @@ -2405,20 +2408,20 @@ static void dump_one_paca(int cpu) > #endif > > #ifdef CONFIG_PPC_POWERNV > - DUMP(p, core_idle_state_ptr, "px"); > + DUMPPTR(p, core_idle_state_ptr, "p"); > DUMP(p, thread_idle_state, "x"); > DUMP(p, thread_mask, "x"); > DUMP(p, subcore_sibling_mask, "x"); > #endif > > - DUMP(p, accounting.utime, "llx"); > - DUMP(p, accounting.stime, "llx"); > - DUMP(p, accounting.utime_scaled, "llx"); > - DUMP(p, accounting.starttime, "llx"); > - DUMP(p, accounting.starttime_user, "llx"); > - DUMP(p, accounting.startspurr, "llx"); > - DUMP(p, accounting.utime_sspurr, "llx"); > - DUMP(p, accounting.steal_time, "llx"); > + DUMP(p, accounting.utime, "lx"); > + DUMP(p, accounting.stime, "lx"); > + DUMP(p, accounting.utime_scaled, "lx"); > + DUMP(p, accounting.starttime, "lx"); > + DUMP(p, accounting.starttime_user, "lx"); > + DUMP(p, accounting.startspurr, "lx"); > + DUMP(p, accounting.utime_sspurr, "lx"); > + DUMP(p, accounting.steal_time, "lx"); > #undef DUMP > > catch_memory_errors =3D 0; > @@ -2564,7 +2567,7 @@ static void dump_by_size(unsigned long addr, long c= ount, int size) > default: val =3D 0; > } > > - printf("%0*lx", size * 2, val); > + printf("%0*llx", size * 2, val); > } > printf("\n"); > } > @@ -2728,7 +2731,7 @@ generic_inst_dump(unsigned long adr, long count, in= t praddr, > dotted =3D 0; > last_inst =3D inst; > if (praddr) > - printf(REG" %.8x", adr, inst); > + printf(REG" %.8lx", adr, inst); > printf("\t"); > dump_func(inst, adr); > printf("\n"); > @@ -2860,7 +2863,7 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsi= gned nb, unsigned maxpr) > for( n =3D nb; n > 0; --n ) > if( *p1++ !=3D *p2++ ) > if( ++prt <=3D 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); > @@ -2920,13 +2923,13 @@ memzcan(void) > if (ok && !ook) { > printf("%.8x .. ", a); > } else if (!ok && ook) > - printf("%.8x\n", a - mskip); > + printf("%.8lx\n", a - mskip); > ook =3D ok; > if (a + mskip < a) > break; > } > if (ook) > - printf("%.8x\n", a - mskip); > + printf("%.8lx\n", a - mskip); > } > > static void show_task(struct task_struct *tsk) > @@ -3010,13 +3013,13 @@ static void show_pte(unsigned long addr) > return; > } > > - printf("pgd @ 0x%016lx\n", pgdir); > + printf("pgd @ 0x%p\n", pgdir); > > if (pgd_huge(*pgdp)) { > format_pte(pgdp, pgd_val(*pgdp)); > return; > } > - printf("pgdp @ 0x%016lx =3D 0x%016lx\n", pgdp, pgd_val(*pgdp)); > + printf("pgdp @ 0x%p =3D 0x%016lx\n", pgdp, pgd_val(*pgdp)); > > pudp =3D pud_offset(pgdp, addr); > > @@ -3030,7 +3033,7 @@ static void show_pte(unsigned long addr) > return; > } > > - printf("pudp @ 0x%016lx =3D 0x%016lx\n", pudp, pud_val(*pudp)); > + printf("pudp @ 0x%p =3D 0x%016lx\n", pudp, pud_val(*pudp)); > > pmdp =3D pmd_offset(pudp, addr); > > @@ -3043,7 +3046,7 @@ static void show_pte(unsigned long addr) > format_pte(pmdp, pmd_val(*pmdp)); > return; > } > - printf("pmdp @ 0x%016lx =3D 0x%016lx\n", pmdp, pmd_val(*pmdp)); > + printf("pmdp @ 0x%p =3D 0x%016lx\n", pmdp, pmd_val(*pmdp)); > > ptep =3D pte_offset_map(pmdp, addr); > if (pte_none(*ptep)) { > @@ -3847,19 +3850,19 @@ static void dump_spu_fields(struct spu *spu) > DUMP_FIELD(spu, "0x%lx", ls_size); > DUMP_FIELD(spu, "0x%x", node); > DUMP_FIELD(spu, "0x%lx", flags); > - DUMP_FIELD(spu, "%d", class_0_pending); > - DUMP_FIELD(spu, "0x%lx", class_0_dar); > - DUMP_FIELD(spu, "0x%lx", class_1_dar); > - DUMP_FIELD(spu, "0x%lx", class_1_dsisr); > - DUMP_FIELD(spu, "0x%lx", irqs[0]); > - DUMP_FIELD(spu, "0x%lx", irqs[1]); > - DUMP_FIELD(spu, "0x%lx", irqs[2]); > + DUMP_FIELD(spu, "%llu", class_0_pending); > + DUMP_FIELD(spu, "0x%llx", class_0_dar); > + DUMP_FIELD(spu, "0x%llx", class_1_dar); > + DUMP_FIELD(spu, "0x%llx", class_1_dsisr); > + DUMP_FIELD(spu, "0x%x", irqs[0]); > + DUMP_FIELD(spu, "0x%x", irqs[1]); > + DUMP_FIELD(spu, "0x%x", irqs[2]); > DUMP_FIELD(spu, "0x%x", slb_replace); > DUMP_FIELD(spu, "%d", pid); > DUMP_FIELD(spu, "0x%p", mm); > DUMP_FIELD(spu, "0x%p", ctx); > DUMP_FIELD(spu, "0x%p", rq); > - DUMP_FIELD(spu, "0x%p", timestamp); > + DUMP_FIELD(spu, "0x%llx", timestamp); > DUMP_FIELD(spu, "0x%lx", problem_phys); > DUMP_FIELD(spu, "0x%p", problem); > DUMP_VALUE("0x%x", problem->spu_runcntl_RW, > @@ -3890,7 +3893,7 @@ static void dump_spu_ls(unsigned long num, int subc= md) > __delay(200); > } else { > catch_memory_errors =3D 0; > - printf("*** Error: accessing spu info for spu %d\n", num)= ; > + printf("*** Error: accessing spu info for spu %ld\n", num= ); > return; > } > catch_memory_errors =3D 0; > -- > 2.11.0 > ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [v2] xmon: Use __printf markup to silence compiler 2018-03-25 9:06 ` [PATCH v2] " Mathieu Malaterre 2018-04-24 18:55 ` Mathieu Malaterre @ 2018-05-25 11:41 ` Michael Ellerman 1 sibling, 0 replies; 25+ messages in thread From: Michael Ellerman @ 2018-05-25 11:41 UTC (permalink / raw) To: Mathieu Malaterre Cc: Mathieu Malaterre, Paul Mackerras, linuxppc-dev, linux-kernel [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 3731 bytes --] On Sun, 2018-03-25 at 09:06:47 UTC, Mathieu Malaterre wrote: > 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. > > Solve the original warning: > > arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] > > In turn this uncovered the following (partial list) warnings (treated as > errors with W=1): > > arch/powerpc/xmon/xmon.c:2866:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘unsigned char *’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1607:31: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘struct pt_regs *’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [-Werror=format-extra-args] > arch/powerpc/xmon/xmon.c:1623:26: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘struct task_struct *’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:630:36: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1392:15: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:2570:16: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1629:25: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘pid_t {aka int}’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1168:18: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:3016:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pgd_t * {aka struct <anonymous> *}’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%p’ expects argument of type ‘void *’, but argument 4 has type ‘long long unsigned int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:3896:50: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] > arch/powerpc/xmon/spu-dis.c:137:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:1665:17: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Werror=format=] > arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with ‘%p’ gnu_printf format [-Werror=format=] > > Signed-off-by: Mathieu Malaterre <malat@debian.org> Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/e70d8f55268ba95f00c61857df2bab cheers ^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 02/19] ppc32: change %x into %lx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 03/19] ppc32: Change %.16x into %p Mathieu Malaterre ` (16 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘memdiffs’: ../arch/powerpc/xmon/xmon.c:2866: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:2866: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 <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index ee113a6e008c..ee7a8c9a042b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1671,7 +1671,7 @@ static void prregs(struct pt_regs *fp) } #else for (n = 0; n < 32; ++n) { - printf("R%.2d = %.8x%s", n, fp->gpr[n], + printf("R%.2d = %.8lx%s", n, fp->gpr[n], (n & 3) == 3? "\n": " "); if (n == 12 && !FULL_REGS(fp)) { printf("\n"); @@ -2728,7 +2728,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr, dotted = 0; last_inst = inst; if (praddr) - printf(REG" %.8x", adr, inst); + printf(REG" %.8lx", adr, inst); printf("\t"); dump_func(inst, adr); printf("\n"); @@ -2920,13 +2920,13 @@ memzcan(void) if (ok && !ook) { printf("%.8x .. ", a); } else if (!ok && ook) - printf("%.8x\n", a - mskip); + printf("%.8lx\n", a - mskip); ook = ok; if (a + mskip < a) break; } if (ook) - printf("%.8x\n", a - mskip); + printf("%.8lx\n", a - mskip); } static void show_task(struct task_struct *tsk) -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 03/19] ppc32: Change %.16x into %p 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 02/19] ppc32: change %x into %lx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 04/19] ppc32: change %lx " Mathieu Malaterre ` (15 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre 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 <malat@debian.org> --- 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 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 04/19] ppc32: change %lx into %p 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (2 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 03/19] ppc32: Change %.16x into %p Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 05/19] ppc32: change %lx into %tx (ptrdiff_t) Mathieu Malaterre ` (14 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre also remove extra fp->link since no formatter associated. CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘excprint’: ../arch/powerpc/xmon/xmon.c:1607:31: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘struct pt_regs *’ [-Werror=format=] printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp); ^ ../arch/powerpc/xmon/xmon.c:1611:9: error: too many arguments for format [-Werror=format-extra-args] printf(" lr: ", fp->link); ^~~~~~~~~~ ../arch/powerpc/xmon/xmon.c:1623:26: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘struct task_struct *’ [-Werror=format=] printf(" current = 0x%lx\n", current); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index f155f030550f..15011be7a051 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1604,11 +1604,11 @@ static void excprint(struct pt_regs *fp) #endif /* CONFIG_SMP */ trap = TRAP(fp); - printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp); + printf("Vector: %lx %s at [%p]\n", fp->trap, getvecname(trap), fp); printf(" pc: "); xmon_print_symbol(fp->nip, ": ", "\n"); - printf(" lr: ", fp->link); + printf(" lr: "); xmon_print_symbol(fp->link, ": ", "\n"); printf(" sp: %lx\n", fp->gpr[1]); @@ -1620,7 +1620,7 @@ static void excprint(struct pt_regs *fp) printf(" dsisr: %lx\n", fp->dsisr); } - printf(" current = 0x%lx\n", current); + printf(" current = 0x%p\n", current); #ifdef CONFIG_PPC64 printf(" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n", local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 05/19] ppc32: change %lx into %tx (ptrdiff_t) 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (3 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 04/19] ppc32: change %lx " Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 06/19] ppc64: change %lx into %llx Mathieu Malaterre ` (13 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o arch/powerpc/xmon/xmon.c: In function ‘xmon_core’: arch/powerpc/xmon/xmon.c:630:36: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Werror=format=] printf("Stopped at breakpoint %lx (", BP_NUM(bp)); ^ arch/powerpc/xmon/xmon.c: In function ‘bpt_cmds’: arch/powerpc/xmon/xmon.c:1365:32: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Werror=format=] printf("Cleared breakpoint %lx (", BP_NUM(bp)); ^ cc1: all warnings being treated as errors and CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘bpt_cmds’: ../arch/powerpc/xmon/xmon.c:1392:15: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=] printf("%2x %s ", BP_NUM(bp), ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 15011be7a051..0d74c0d1a0bf 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -627,7 +627,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) excprint(regs); bp = at_breakpoint(regs->nip); if (bp) { - printf("Stopped at breakpoint %lx (", BP_NUM(bp)); + printf("Stopped at breakpoint %tx (", BP_NUM(bp)); xmon_print_symbol(regs->nip, " ", ")\n"); } if (unrecoverable_excp(regs)) @@ -1362,7 +1362,7 @@ bpt_cmds(void) } } - printf("Cleared breakpoint %lx (", BP_NUM(bp)); + printf("Cleared breakpoint %tx (", BP_NUM(bp)); xmon_print_symbol(bp->address, " ", ")\n"); bp->enabled = 0; break; @@ -1389,7 +1389,7 @@ bpt_cmds(void) for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { if (!bp->enabled) continue; - printf("%2x %s ", BP_NUM(bp), + printf("%tx %s ", BP_NUM(bp), (bp->enabled & BP_CIABR) ? "inst": "trap"); xmon_print_symbol(bp->address, " ", "\n"); } -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 06/19] ppc64: change %lx into %llx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (4 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 05/19] ppc32: change %lx into %tx (ptrdiff_t) Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 07/19] ppc64: change %ld into %d Mathieu Malaterre ` (12 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_by_size’: ../arch/powerpc/xmon/xmon.c:2570:16: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] printf("%0*lx", size * 2, val); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 0d74c0d1a0bf..738888e6a927 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -2564,7 +2564,7 @@ static void dump_by_size(unsigned long addr, long count, int size) default: val = 0; } - printf("%0*lx", size * 2, val); + printf("%0*llx", size * 2, val); } printf("\n"); } -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 07/19] ppc64: change %ld into %d 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (5 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 06/19] ppc64: change %lx into %llx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 08/19] ppc64: change %x into %lx Mathieu Malaterre ` (11 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘excprint’: ../arch/powerpc/xmon/xmon.c:1629:25: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘pid_t {aka int}’ [-Werror=format=] printf(" pid = %ld, comm = %s\n", ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 738888e6a927..6117164cb5ba 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1626,7 +1626,7 @@ static void excprint(struct pt_regs *fp) local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); #endif if (current) { - printf(" pid = %ld, comm = %s\n", + printf(" pid = %d, comm = %s\n", current->pid, current->comm); } -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 08/19] ppc64: change %x into %lx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (6 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 07/19] ppc64: change %ld into %d Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 09/19] ppc64: change %016lx into %p Mathieu Malaterre ` (10 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘cpu_cmd’: ../arch/powerpc/xmon/xmon.c:1168:18: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("cpu 0x%x isn't in xmon\n", cpu); ^ ../arch/powerpc/xmon/xmon.c:1182:19: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("cpu 0x%x didn't take control\n", cpu); ^ ../arch/powerpc/xmon/xmon.c: In function ‘dump_206_sprs’: ../arch/powerpc/xmon/xmon.c:1778:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1780:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("dscr = %.16lx ppr = %.16lx pir = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1788:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1792:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c: In function ‘dump_207_sprs’: ../arch/powerpc/xmon/xmon.c:1809:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("dpdes = %.16lx tir = %.16lx cir = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1812:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("fscr = %.16lx tar = %.16lx pspb = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1825:22: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1825:34: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1825:47: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1825:62: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1828:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8x\n", ^ ../arch/powerpc/xmon/xmon.c:1830:54: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] printf("sdar = %.16lx sier = %.16lx pmc6 = %.8x\n", ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/spu-dis.c | 2 +- arch/powerpc/xmon/xmon.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c index e5f89837c82e..6b83b680b9f6 100644 --- a/arch/powerpc/xmon/spu-dis.c +++ b/arch/powerpc/xmon/spu-dis.c @@ -102,7 +102,7 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) if (index == 0) { - printf(".long 0x%x", insn); + printf(".long 0x%lx", insn); } else { diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 6117164cb5ba..0e4dcdf12f9e 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1165,7 +1165,7 @@ static int cpu_cmd(void) } /* try to switch to cpu specified */ if (!cpumask_test_cpu(cpu, &cpus_in_xmon)) { - printf("cpu 0x%x isn't in xmon\n", cpu); + printf("cpu 0x%lx isn't in xmon\n", cpu); return 0; } xmon_taken = 0; @@ -1179,7 +1179,7 @@ static int cpu_cmd(void) /* take control back */ mb(); xmon_owner = smp_processor_id(); - printf("cpu 0x%x didn't take control\n", cpu); + printf("cpu 0x%lx didn't take control\n", cpu); return 0; } barrier(); @@ -1775,9 +1775,9 @@ static void dump_206_sprs(void) /* Actually some of these pre-date 2.06, but whatevs */ - printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8x\n", + printf("srr0 = %.16lx srr1 = %.16lx dsisr = %.8lx\n", mfspr(SPRN_SRR0), mfspr(SPRN_SRR1), mfspr(SPRN_DSISR)); - printf("dscr = %.16lx ppr = %.16lx pir = %.8x\n", + printf("dscr = %.16lx ppr = %.16lx pir = %.8lx\n", mfspr(SPRN_DSCR), mfspr(SPRN_PPR), mfspr(SPRN_PIR)); printf("amr = %.16lx uamor = %.16lx\n", mfspr(SPRN_AMR), mfspr(SPRN_UAMOR)); @@ -1785,11 +1785,11 @@ static void dump_206_sprs(void) if (!(mfmsr() & MSR_HV)) return; - printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8x\n", + printf("sdr1 = %.16lx hdar = %.16lx hdsisr = %.8lx\n", mfspr(SPRN_SDR1), mfspr(SPRN_HDAR), mfspr(SPRN_HDSISR)); printf("hsrr0 = %.16lx hsrr1 = %.16lx hdec = %.16lx\n", mfspr(SPRN_HSRR0), mfspr(SPRN_HSRR1), mfspr(SPRN_HDEC)); - printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8x\n", + printf("lpcr = %.16lx pcr = %.16lx lpidr = %.8lx\n", mfspr(SPRN_LPCR), mfspr(SPRN_PCR), mfspr(SPRN_LPID)); printf("hsprg0 = %.16lx hsprg1 = %.16lx amor = %.16lx\n", mfspr(SPRN_HSPRG0), mfspr(SPRN_HSPRG1), mfspr(SPRN_AMOR)); @@ -1806,10 +1806,10 @@ static void dump_207_sprs(void) if (!cpu_has_feature(CPU_FTR_ARCH_207S)) return; - printf("dpdes = %.16lx tir = %.16lx cir = %.8x\n", + printf("dpdes = %.16lx tir = %.16lx cir = %.8lx\n", mfspr(SPRN_DPDES), mfspr(SPRN_TIR), mfspr(SPRN_CIR)); - printf("fscr = %.16lx tar = %.16lx pspb = %.8x\n", + printf("fscr = %.16lx tar = %.16lx pspb = %.8lx\n", mfspr(SPRN_FSCR), mfspr(SPRN_TAR), mfspr(SPRN_PSPB)); msr = mfmsr(); @@ -1822,12 +1822,12 @@ static void dump_207_sprs(void) printf("mmcr0 = %.16lx mmcr1 = %.16lx mmcr2 = %.16lx\n", mfspr(SPRN_MMCR0), mfspr(SPRN_MMCR1), mfspr(SPRN_MMCR2)); - printf("pmc1 = %.8x pmc2 = %.8x pmc3 = %.8x pmc4 = %.8x\n", + printf("pmc1 = %.8lx pmc2 = %.8lx pmc3 = %.8lx pmc4 = %.8lx\n", mfspr(SPRN_PMC1), mfspr(SPRN_PMC2), mfspr(SPRN_PMC3), mfspr(SPRN_PMC4)); - printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8x\n", + printf("mmcra = %.16lx siar = %.16lx pmc5 = %.8lx\n", mfspr(SPRN_MMCRA), mfspr(SPRN_SIAR), mfspr(SPRN_PMC5)); - printf("sdar = %.16lx sier = %.16lx pmc6 = %.8x\n", + printf("sdar = %.16lx sier = %.16lx pmc6 = %.8lx\n", mfspr(SPRN_SDAR), mfspr(SPRN_SIER), mfspr(SPRN_PMC6)); printf("ebbhr = %.16lx ebbrr = %.16lx bescr = %.16lx\n", mfspr(SPRN_EBBHR), mfspr(SPRN_EBBRR), mfspr(SPRN_BESCR)); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 09/19] ppc64: change %016lx into %p 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (7 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 08/19] ppc64: change %x into %lx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 10/19] ppc64: change %lx " Mathieu Malaterre ` (9 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘show_pte’: ../arch/powerpc/xmon/xmon.c:3016:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pgd_t * {aka struct <anonymous> *}’ [-Werror=format=] printf("pgd @ 0x%016lx\n", pgdir); ^ ../arch/powerpc/xmon/xmon.c:3022:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pgd_t * {aka struct <anonymous> *}’ [-Werror=format=] printf("pgdp @ 0x%016lx = 0x%016lx\n", pgdp, pgd_val(*pgdp)); ^ ../arch/powerpc/xmon/xmon.c:3036:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pud_t * {aka struct <anonymous> *}’ [-Werror=format=] printf("pudp @ 0x%016lx = 0x%016lx\n", pudp, pud_val(*pudp)); ^ ../arch/powerpc/xmon/xmon.c:3049:24: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘pmd_t * {aka struct <anonymous> *}’ [-Werror=format=] printf("pmdp @ 0x%016lx = 0x%016lx\n", pmdp, pmd_val(*pmdp)); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 0e4dcdf12f9e..69152f00d3fc 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3010,13 +3010,13 @@ static void show_pte(unsigned long addr) return; } - printf("pgd @ 0x%016lx\n", pgdir); + printf("pgd @ 0x%p\n", pgdir); if (pgd_huge(*pgdp)) { format_pte(pgdp, pgd_val(*pgdp)); return; } - printf("pgdp @ 0x%016lx = 0x%016lx\n", pgdp, pgd_val(*pgdp)); + printf("pgdp @ 0x%p = 0x%016lx\n", pgdp, pgd_val(*pgdp)); pudp = pud_offset(pgdp, addr); @@ -3030,7 +3030,7 @@ static void show_pte(unsigned long addr) return; } - printf("pudp @ 0x%016lx = 0x%016lx\n", pudp, pud_val(*pudp)); + printf("pudp @ 0x%p = 0x%016lx\n", pudp, pud_val(*pudp)); pmdp = pmd_offset(pudp, addr); @@ -3043,7 +3043,7 @@ static void show_pte(unsigned long addr) format_pte(pmdp, pmd_val(*pmdp)); return; } - printf("pmdp @ 0x%016lx = 0x%016lx\n", pmdp, pmd_val(*pmdp)); + printf("pmdp @ 0x%p = 0x%016lx\n", pmdp, pmd_val(*pmdp)); ptep = pte_offset_map(pmdp, addr); if (pte_none(*ptep)) { -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 10/19] ppc64: change %lx into %p 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (8 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 09/19] ppc64: change %016lx into %p Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 11/19] ppc64: change %lx into %x Mathieu Malaterre ` (8 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘excprint’: ../arch/powerpc/xmon/xmon.c:1625:26: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘struct paca_struct *’ [-Werror=format=] printf(" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n", ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 69152f00d3fc..e706139030ad 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1622,7 +1622,7 @@ static void excprint(struct pt_regs *fp) printf(" current = 0x%p\n", current); #ifdef CONFIG_PPC64 - printf(" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n", + printf(" paca = 0x%p\t softe: %d\t irq_happened: 0x%02x\n", local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); #endif if (current) { -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 11/19] ppc64: change %lx into %x 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (9 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 10/19] ppc64: change %lx " Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 12/19] ppc64: change %lx into %llx Mathieu Malaterre ` (7 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_one_paca’: ../arch/powerpc/xmon/xmon.c:2380:43: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘u32 {aka unsigned int}’ [-Werror=format=] printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index e706139030ad..7eb656274ea7 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -2374,7 +2374,7 @@ static void dump_one_paca(int cpu) DUMP(p, vmalloc_sllp, "x"); DUMP(p, slb_cache_ptr, "x"); for (i = 0; i < SLB_CACHE_ENTRIES; i++) - printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); + printf(" slb_cache[%d]: = 0x%016x\n", i, p->slb_cache[i]); DUMP(p, rfi_flush_fallback_area, "px"); #endif @@ -3851,9 +3851,9 @@ static void dump_spu_fields(struct spu *spu) DUMP_FIELD(spu, "0x%lx", class_0_dar); DUMP_FIELD(spu, "0x%lx", class_1_dar); DUMP_FIELD(spu, "0x%lx", class_1_dsisr); - DUMP_FIELD(spu, "0x%lx", irqs[0]); - DUMP_FIELD(spu, "0x%lx", irqs[1]); - DUMP_FIELD(spu, "0x%lx", irqs[2]); + DUMP_FIELD(spu, "0x%x", irqs[0]); + DUMP_FIELD(spu, "0x%x", irqs[1]); + DUMP_FIELD(spu, "0x%x", irqs[2]); DUMP_FIELD(spu, "0x%x", slb_replace); DUMP_FIELD(spu, "%d", pid); DUMP_FIELD(spu, "0x%p", mm); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 12/19] ppc64: change %lx into %llx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (10 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 11/19] ppc64: change %lx into %x Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 13/19] ppc64: change %llx into %lx Mathieu Malaterre ` (6 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_one_paca’: ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2347:2: note: in expansion of macro ‘DUMP’ DUMP(p, kernel_toc, "lx"); ^~~~ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 7eb656274ea7..96247ac91a86 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -2341,9 +2341,9 @@ static void dump_one_paca(int cpu) DUMP(p, lock_token, "x"); DUMP(p, paca_index, "x"); - DUMP(p, kernel_toc, "lx"); - DUMP(p, kernelbase, "lx"); - DUMP(p, kernel_msr, "lx"); + DUMP(p, kernel_toc, "llx"); + DUMP(p, kernelbase, "llx"); + DUMP(p, kernel_msr, "llx"); DUMP(p, emergency_sp, "px"); #ifdef CONFIG_PPC_BOOK3S_64 DUMP(p, nmi_emergency_sp, "px"); @@ -2352,7 +2352,7 @@ static void dump_one_paca(int cpu) DUMP(p, in_mce, "x"); DUMP(p, hmi_event_available, "x"); #endif - DUMP(p, data_offset, "lx"); + DUMP(p, data_offset, "llx"); DUMP(p, hw_cpu_id, "x"); DUMP(p, cpu_start, "x"); DUMP(p, kexec_state, "x"); @@ -2367,7 +2367,7 @@ static void dump_one_paca(int cpu) vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); if (esid || vsid) { - printf(" slb_shadow[%d]: = 0x%016lx 0x%016lx\n", + printf(" slb_shadow[%d]: = 0x%016llx 0x%016llx\n", i, esid, vsid); } } @@ -2388,10 +2388,10 @@ static void dump_one_paca(int cpu) DUMP(p, dbg_kstack, "px"); #endif DUMP(p, __current, "px"); - DUMP(p, kstack, "lx"); - printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); - DUMP(p, stab_rr, "lx"); - DUMP(p, saved_r1, "lx"); + DUMP(p, kstack, "llx"); + printf(" kstack_base = 0x%016llx\n", p->kstack & ~(THREAD_SIZE - 1)); + DUMP(p, stab_rr, "llx"); + DUMP(p, saved_r1, "llx"); DUMP(p, trap_save, "x"); DUMP(p, irq_soft_mask, "x"); DUMP(p, irq_happened, "x"); @@ -3848,9 +3848,9 @@ static void dump_spu_fields(struct spu *spu) DUMP_FIELD(spu, "0x%x", node); DUMP_FIELD(spu, "0x%lx", flags); DUMP_FIELD(spu, "%d", class_0_pending); - DUMP_FIELD(spu, "0x%lx", class_0_dar); - DUMP_FIELD(spu, "0x%lx", class_1_dar); - DUMP_FIELD(spu, "0x%lx", class_1_dsisr); + DUMP_FIELD(spu, "0x%llx", class_0_dar); + DUMP_FIELD(spu, "0x%llx", class_1_dar); + DUMP_FIELD(spu, "0x%llx", class_1_dsisr); DUMP_FIELD(spu, "0x%x", irqs[0]); DUMP_FIELD(spu, "0x%x", irqs[1]); DUMP_FIELD(spu, "0x%x", irqs[2]); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 13/19] ppc64: change %llx into %lx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (11 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 12/19] ppc64: change %lx into %llx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 14/19] ppc64: change %p into %llx Mathieu Malaterre ` (5 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_one_paca’: ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2417:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.utime, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2418:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.stime, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2419:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.utime_scaled, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2420:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.starttime, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2421:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.starttime_user, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2422:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.startspurr, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2423:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.utime_sspurr, "llx"); ^~~~ ../arch/powerpc/xmon/xmon.c:2339:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2424:2: note: in expansion of macro ‘DUMP’ DUMP(p, accounting.steal_time, "llx"); ^~~~ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 96247ac91a86..61f5e09367d0 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -2411,14 +2411,14 @@ static void dump_one_paca(int cpu) DUMP(p, subcore_sibling_mask, "x"); #endif - DUMP(p, accounting.utime, "llx"); - DUMP(p, accounting.stime, "llx"); - DUMP(p, accounting.utime_scaled, "llx"); - DUMP(p, accounting.starttime, "llx"); - DUMP(p, accounting.starttime_user, "llx"); - DUMP(p, accounting.startspurr, "llx"); - DUMP(p, accounting.utime_sspurr, "llx"); - DUMP(p, accounting.steal_time, "llx"); + DUMP(p, accounting.utime, "lx"); + DUMP(p, accounting.stime, "lx"); + DUMP(p, accounting.utime_scaled, "lx"); + DUMP(p, accounting.starttime, "lx"); + DUMP(p, accounting.starttime_user, "lx"); + DUMP(p, accounting.startspurr, "lx"); + DUMP(p, accounting.utime_sspurr, "lx"); + DUMP(p, accounting.steal_time, "lx"); #undef DUMP catch_memory_errors = 0; -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 14/19] ppc64: change %p into %llx 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (12 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 13/19] ppc64: change %llx into %lx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 15/19] ppc64: change %d into %ld Mathieu Malaterre ` (4 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_spu_fields’: ../arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%p’ expects argument of type ‘void *’, but argument 4 has type ‘long long unsigned int’ [-Werror=format=] printf(" %-*s = "format"\n", DUMP_WIDTH, \ ^ ../arch/powerpc/xmon/xmon.c:3840:2: note: in expansion of macro ‘DUMP_VALUE’ DUMP_VALUE(format, field, obj->field) ^~~~~~~~~~ ../arch/powerpc/xmon/xmon.c:3865:2: note: in expansion of macro ‘DUMP_FIELD’ DUMP_FIELD(spu, "0x%p", timestamp); ^~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 61f5e09367d0..6b5b5318099d 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3859,7 +3859,7 @@ static void dump_spu_fields(struct spu *spu) DUMP_FIELD(spu, "0x%p", mm); DUMP_FIELD(spu, "0x%p", ctx); DUMP_FIELD(spu, "0x%p", rq); - DUMP_FIELD(spu, "0x%p", timestamp); + DUMP_FIELD(spu, "0x%llx", timestamp); DUMP_FIELD(spu, "0x%lx", problem_phys); DUMP_FIELD(spu, "0x%p", problem); DUMP_VALUE("0x%x", problem->spu_runcntl_RW, -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 15/19] ppc64: change %d into %ld 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (13 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 14/19] ppc64: change %p into %llx Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 16/19] ppc64: Change %d into %lu Mathieu Malaterre ` (3 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_spu_ls’: ../arch/powerpc/xmon/xmon.c:3896:50: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("*** Error: accessing spu info for spu %d\n", num); ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 6b5b5318099d..c9a44962d3c9 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3890,7 +3890,7 @@ static void dump_spu_ls(unsigned long num, int subcmd) __delay(200); } else { catch_memory_errors = 0; - printf("*** Error: accessing spu info for spu %d\n", num); + printf("*** Error: accessing spu info for spu %ld\n", num); return; } catch_memory_errors = 0; -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 16/19] ppc64: Change %d into %lu 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (14 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 15/19] ppc64: change %d into %ld Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 17/19] ppc64: change %d into %llu Mathieu Malaterre ` (2 subsequent siblings) 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/spu-dis.o ../arch/powerpc/xmon/spu-dis.c: In function ‘print_insn_spu’: ../arch/powerpc/xmon/spu-dis.c:137:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$%d", ^ ../arch/powerpc/xmon/spu-dis.c:141:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$%d", ^ ../arch/powerpc/xmon/spu-dis.c:145:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$%d", ^ ../arch/powerpc/xmon/spu-dis.c:149:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$%d", ^ ../arch/powerpc/xmon/spu-dis.c:153:20: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$sp%d", ^ ../arch/powerpc/xmon/spu-dis.c:157:20: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("$ch%d", ^ ../arch/powerpc/xmon/spu-dis.c:165:17: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("%d", ^ ../arch/powerpc/xmon/spu-dis.c:169:17: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=] printf("%d", ^ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/spu-dis.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c index 6b83b680b9f6..4cbc7da88524 100644 --- a/arch/powerpc/xmon/spu-dis.c +++ b/arch/powerpc/xmon/spu-dis.c @@ -134,27 +134,27 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) switch (arg) { case A_T: - printf("$%d", + printf("$%lu", DECODE_INSN_RT (insn)); break; case A_A: - printf("$%d", + printf("$%lu", DECODE_INSN_RA (insn)); break; case A_B: - printf("$%d", + printf("$%lu", DECODE_INSN_RB (insn)); break; case A_C: - printf("$%d", + printf("$%lu", DECODE_INSN_RC (insn)); break; case A_S: - printf("$sp%d", + printf("$sp%lu", DECODE_INSN_RA (insn)); break; case A_H: - printf("$ch%d", + printf("$ch%lu", DECODE_INSN_RA (insn)); break; case A_P: @@ -162,11 +162,11 @@ print_insn_spu (unsigned long insn, unsigned long memaddr) printf("("); break; case A_U7A: - printf("%d", + printf("%lu", 173 - DECODE_INSN_U8 (insn)); break; case A_U7B: - printf("%d", + printf("%lu", 155 - DECODE_INSN_U8 (insn)); break; case A_S3: -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 17/19] ppc64: change %d into %llu 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (15 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 16/19] ppc64: Change %d into %lu Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 18/19] ppc64: change %ld into %d Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 19/19] ppc64: Handle %p format in DUMPPTR() function-like macro Mathieu Malaterre 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_spu_fields’: ../arch/powerpc/xmon/xmon.c:3827:10: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=] printf(" %-*s = "format"\n", DUMP_WIDTH, \ ^ ../arch/powerpc/xmon/xmon.c:3840:2: note: in expansion of macro ‘DUMP_VALUE’ DUMP_VALUE(format, field, obj->field) ^~~~~~~~~~ ../arch/powerpc/xmon/xmon.c:3853:2: note: in expansion of macro ‘DUMP_FIELD’ DUMP_FIELD(spu, "%d", class_0_pending); ^~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- 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 c9a44962d3c9..4479245c6361 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3847,7 +3847,7 @@ static void dump_spu_fields(struct spu *spu) DUMP_FIELD(spu, "0x%lx", ls_size); DUMP_FIELD(spu, "0x%x", node); DUMP_FIELD(spu, "0x%lx", flags); - DUMP_FIELD(spu, "%d", class_0_pending); + DUMP_FIELD(spu, "%llu", class_0_pending); DUMP_FIELD(spu, "0x%llx", class_0_dar); DUMP_FIELD(spu, "0x%llx", class_1_dar); DUMP_FIELD(spu, "0x%llx", class_1_dsisr); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 18/19] ppc64: change %ld into %d 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (16 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 17/19] ppc64: change %d into %llu Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 19/19] ppc64: Handle %p format in DUMPPTR() function-like macro Mathieu Malaterre 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘prregs’: ../arch/powerpc/xmon/xmon.c:1665:17: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^ ../arch/powerpc/xmon/xmon.c:1665:11: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int’ [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^~~~~~~~~~~ ../arch/powerpc/xmon/xmon.c:1669:17: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^ ../arch/powerpc/xmon/xmon.c:1669:11: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int’ [-Werror=format=] printf("R%.2ld = "REG" R%.2ld = "REG"\n", ^~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 4479245c6361..a87f14a24849 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1662,11 +1662,11 @@ static void prregs(struct pt_regs *fp) #ifdef CONFIG_PPC64 if (FULL_REGS(fp)) { for (n = 0; n < 16; ++n) - printf("R%.2ld = "REG" R%.2ld = "REG"\n", + printf("R%.2d = "REG" R%.2d = "REG"\n", n, fp->gpr[n], n+16, fp->gpr[n+16]); } else { for (n = 0; n < 7; ++n) - printf("R%.2ld = "REG" R%.2ld = "REG"\n", + printf("R%.2d = "REG" R%.2d = "REG"\n", n, fp->gpr[n], n+7, fp->gpr[n+7]); } #else -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 19/19] ppc64: Handle %p format in DUMPPTR() function-like macro 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre ` (17 preceding siblings ...) 2018-03-16 11:02 ` [PATCH 18/19] ppc64: change %ld into %d Mathieu Malaterre @ 2018-03-16 11:02 ` Mathieu Malaterre 18 siblings, 0 replies; 25+ messages in thread From: Mathieu Malaterre @ 2018-03-16 11:02 UTC (permalink / raw) To: Michael Ellerman Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Mathieu Malaterre CC arch/powerpc/xmon/xmon.o ../arch/powerpc/xmon/xmon.c: In function ‘dump_one_paca’: ../arch/powerpc/xmon/xmon.c:2339:9: error: '#' flag used with ‘%p’ gnu_printf format [-Werror=format=] printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ ^ ../arch/powerpc/xmon/xmon.c:2347:2: note: in expansion of macro ‘DUMP’ DUMP(p, emergency_sp, "px"); while at it fix warning reported by checkpatch: WARNING: macros should not use a trailing semicolon Signed-off-by: Mathieu Malaterre <malat@debian.org> --- arch/powerpc/xmon/xmon.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index a87f14a24849..edd7ea85272f 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -2337,17 +2337,20 @@ static void dump_one_paca(int cpu) #define DUMP(paca, name, format) \ printf(" %-*s = %#-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ - offsetof(struct paca_struct, name)); + offsetof(struct paca_struct, name)) +#define DUMPPTR(paca, name, format) \ + printf(" %-*s = %-*"format"\t(0x%lx)\n", 20, #name, 18, paca->name, \ + offsetof(struct paca_struct, name)) DUMP(p, lock_token, "x"); DUMP(p, paca_index, "x"); DUMP(p, kernel_toc, "llx"); DUMP(p, kernelbase, "llx"); DUMP(p, kernel_msr, "llx"); - DUMP(p, emergency_sp, "px"); + DUMPPTR(p, emergency_sp, "p"); #ifdef CONFIG_PPC_BOOK3S_64 - DUMP(p, nmi_emergency_sp, "px"); - DUMP(p, mc_emergency_sp, "px"); + DUMPPTR(p, nmi_emergency_sp, "p"); + DUMPPTR(p, mc_emergency_sp, "p"); DUMP(p, in_nmi, "x"); DUMP(p, in_mce, "x"); DUMP(p, hmi_event_available, "x"); @@ -2376,7 +2379,7 @@ static void dump_one_paca(int cpu) for (i = 0; i < SLB_CACHE_ENTRIES; i++) printf(" slb_cache[%d]: = 0x%016x\n", i, p->slb_cache[i]); - DUMP(p, rfi_flush_fallback_area, "px"); + DUMPPTR(p, rfi_flush_fallback_area, "p"); #endif DUMP(p, dscr_default, "llx"); #ifdef CONFIG_PPC_BOOK3E @@ -2387,7 +2390,7 @@ static void dump_one_paca(int cpu) DUMP(p, crit_kstack, "px"); DUMP(p, dbg_kstack, "px"); #endif - DUMP(p, __current, "px"); + DUMPPTR(p, __current, "p"); DUMP(p, kstack, "llx"); printf(" kstack_base = 0x%016llx\n", p->kstack & ~(THREAD_SIZE - 1)); DUMP(p, stab_rr, "llx"); @@ -2405,7 +2408,7 @@ static void dump_one_paca(int cpu) #endif #ifdef CONFIG_PPC_POWERNV - DUMP(p, core_idle_state_ptr, "px"); + DUMPPTR(p, core_idle_state_ptr, "p"); DUMP(p, thread_idle_state, "x"); DUMP(p, thread_mask, "x"); DUMP(p, subcore_sibling_mask, "x"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 25+ messages in thread
end of thread, other threads:[~2018-05-25 11:41 UTC | newest] Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 01/19] xmon: Use __printf markup to silence compiler Mathieu Malaterre 2018-03-17 23:33 ` kbuild test robot 2018-03-18 0:27 ` kbuild test robot 2018-03-25 9:06 ` [PATCH v2] " Mathieu Malaterre 2018-04-24 18:55 ` Mathieu Malaterre 2018-05-25 11:41 ` [v2] " Michael Ellerman 2018-03-16 11:02 ` [PATCH 02/19] ppc32: change %x into %lx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 03/19] ppc32: Change %.16x into %p Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 04/19] ppc32: change %lx " Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 05/19] ppc32: change %lx into %tx (ptrdiff_t) Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 06/19] ppc64: change %lx into %llx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 07/19] ppc64: change %ld into %d Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 08/19] ppc64: change %x into %lx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 09/19] ppc64: change %016lx into %p Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 10/19] ppc64: change %lx " Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 11/19] ppc64: change %lx into %x Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 12/19] ppc64: change %lx into %llx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 13/19] ppc64: change %llx into %lx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 14/19] ppc64: change %p into %llx Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 15/19] ppc64: change %d into %ld Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 16/19] ppc64: Change %d into %lu Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 17/19] ppc64: change %d into %llu Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 18/19] ppc64: change %ld into %d Mathieu Malaterre 2018-03-16 11:02 ` [PATCH 19/19] ppc64: Handle %p format in DUMPPTR() function-like macro Mathieu Malaterre
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).