diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-09-28 23:14:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-02 23:20:34 -0400 |
commit | 5da444aae54f64575a60f1d596ed7706e3089fb0 (patch) | |
tree | 50eb6a60a9c56fc2eaa10d06eb62d28f105058bb | |
parent | 97da37b35fc56ed7b2b1583208be0d1327ddcf30 (diff) |
sparc: fix format string argument for prom_printf()
prom_printf() takes printf style arguments. Specifing GCC's format
attribute reveals that there are several wrong usages of prom_printf().
This fixes those wrong format strings and arguments, and also leaves
format attributes in order to detect similar mistakes at compile time.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc/include/asm/oplib_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/oplib_64.h | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/hvapi.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/prom_64.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 7 | ||||
-rw-r--r-- | arch/sparc/mm/iommu.c | 4 |
7 files changed, 11 insertions, 10 deletions
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h index 27517879a6c2..c72f3045820c 100644 --- a/arch/sparc/include/asm/oplib_32.h +++ b/arch/sparc/include/asm/oplib_32.h | |||
@@ -94,7 +94,7 @@ extern int prom_getprev(void); | |||
94 | extern void prom_console_write_buf(const char *buf, int len); | 94 | extern void prom_console_write_buf(const char *buf, int len); |
95 | 95 | ||
96 | /* Prom's internal routines, don't use in kernel/boot code. */ | 96 | /* Prom's internal routines, don't use in kernel/boot code. */ |
97 | extern void prom_printf(const char *fmt, ...); | 97 | extern __printf(1, 2) void prom_printf(const char *fmt, ...); |
98 | extern void prom_write(const char *buf, unsigned int len); | 98 | extern void prom_write(const char *buf, unsigned int len); |
99 | 99 | ||
100 | /* Multiprocessor operations... */ | 100 | /* Multiprocessor operations... */ |
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index 97a90475c314..a12dbe3b7762 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h | |||
@@ -98,7 +98,7 @@ extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); | |||
98 | extern void prom_console_write_buf(const char *buf, int len); | 98 | extern void prom_console_write_buf(const char *buf, int len); |
99 | 99 | ||
100 | /* Prom's internal routines, don't use in kernel/boot code. */ | 100 | /* Prom's internal routines, don't use in kernel/boot code. */ |
101 | extern void prom_printf(const char *fmt, ...); | 101 | extern __printf(1, 2) void prom_printf(const char *fmt, ...); |
102 | extern void prom_write(const char *buf, unsigned int len); | 102 | extern void prom_write(const char *buf, unsigned int len); |
103 | 103 | ||
104 | /* Multiprocessor operations... */ | 104 | /* Multiprocessor operations... */ |
diff --git a/arch/sparc/kernel/hvapi.c b/arch/sparc/kernel/hvapi.c index 1032df43ec95..c0a2de0fd624 100644 --- a/arch/sparc/kernel/hvapi.c +++ b/arch/sparc/kernel/hvapi.c | |||
@@ -194,7 +194,7 @@ void __init sun4v_hvapi_init(void) | |||
194 | 194 | ||
195 | bad: | 195 | bad: |
196 | prom_printf("HVAPI: Cannot register API group " | 196 | prom_printf("HVAPI: Cannot register API group " |
197 | "%lx with major(%u) minor(%u)\n", | 197 | "%lx with major(%lu) minor(%lu)\n", |
198 | group, major, minor); | 198 | group, major, minor); |
199 | prom_halt(); | 199 | prom_halt(); |
200 | } | 200 | } |
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index 340c5b976d28..d397d7fc5c28 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
@@ -37,7 +37,7 @@ void * __init prom_early_alloc(unsigned long size) | |||
37 | void *ret; | 37 | void *ret; |
38 | 38 | ||
39 | if (!paddr) { | 39 | if (!paddr) { |
40 | prom_printf("prom_early_alloc(%lu) failed\n"); | 40 | prom_printf("prom_early_alloc(%lu) failed\n", size); |
41 | prom_halt(); | 41 | prom_halt(); |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 3b05e6697710..fa1f1d375ffc 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -850,7 +850,7 @@ void __init cheetah_ecache_flush_init(void) | |||
850 | ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size); | 850 | ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size); |
851 | 851 | ||
852 | if (ecache_flush_physbase == ~0UL) { | 852 | if (ecache_flush_physbase == ~0UL) { |
853 | prom_printf("cheetah_ecache_flush_init: Cannot find %d byte " | 853 | prom_printf("cheetah_ecache_flush_init: Cannot find %ld byte " |
854 | "contiguous physical memory.\n", | 854 | "contiguous physical memory.\n", |
855 | ecache_flush_size); | 855 | ecache_flush_size); |
856 | prom_halt(); | 856 | prom_halt(); |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 696bb095e0fc..7a9b788c6ced 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -119,7 +119,8 @@ static void __init read_obp_memory(const char *property, | |||
119 | 119 | ||
120 | ret = prom_getproperty(node, property, (char *) regs, prop_size); | 120 | ret = prom_getproperty(node, property, (char *) regs, prop_size); |
121 | if (ret == -1) { | 121 | if (ret == -1) { |
122 | prom_printf("Couldn't get %s property from /memory.\n"); | 122 | prom_printf("Couldn't get %s property from /memory.\n", |
123 | property); | ||
123 | prom_halt(); | 124 | prom_halt(); |
124 | } | 125 | } |
125 | 126 | ||
@@ -497,7 +498,7 @@ static void __init read_obp_translations(void) | |||
497 | prom_halt(); | 498 | prom_halt(); |
498 | } | 499 | } |
499 | if (unlikely(n > sizeof(prom_trans))) { | 500 | if (unlikely(n > sizeof(prom_trans))) { |
500 | prom_printf("prom_mappings: Size %Zd is too big.\n", n); | 501 | prom_printf("prom_mappings: Size %d is too big.\n", n); |
501 | prom_halt(); | 502 | prom_halt(); |
502 | } | 503 | } |
503 | 504 | ||
@@ -559,7 +560,7 @@ static void __init hypervisor_tlb_lock(unsigned long vaddr, | |||
559 | unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu); | 560 | unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu); |
560 | 561 | ||
561 | if (ret != 0) { | 562 | if (ret != 0) { |
562 | prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: " | 563 | prom_printf("hypervisor_tlb_lock[%lx:%x:%lx:%lx]: " |
563 | "errors with %lx\n", vaddr, 0, pte, mmu, ret); | 564 | "errors with %lx\n", vaddr, 0, pte, mmu, ret); |
564 | prom_halt(); | 565 | prom_halt(); |
565 | } | 566 | } |
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index a8a58cad9d2b..0f4f7191fbba 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c | |||
@@ -90,8 +90,8 @@ static void __init sbus_iommu_init(struct platform_device *op) | |||
90 | it to us. */ | 90 | it to us. */ |
91 | tmp = __get_free_pages(GFP_KERNEL, IOMMU_ORDER); | 91 | tmp = __get_free_pages(GFP_KERNEL, IOMMU_ORDER); |
92 | if (!tmp) { | 92 | if (!tmp) { |
93 | prom_printf("Unable to allocate iommu table [0x%08x]\n", | 93 | prom_printf("Unable to allocate iommu table [0x%lx]\n", |
94 | IOMMU_NPTES*sizeof(iopte_t)); | 94 | IOMMU_NPTES * sizeof(iopte_t)); |
95 | prom_halt(); | 95 | prom_halt(); |
96 | } | 96 | } |
97 | iommu->page_table = (iopte_t *)tmp; | 97 | iommu->page_table = (iopte_t *)tmp; |