提交 5da444aa 编写于 作者: A Akinobu Mita 提交者: David S. Miller

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: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 97da37b3
...@@ -94,7 +94,7 @@ extern int prom_getprev(void); ...@@ -94,7 +94,7 @@ extern int prom_getprev(void);
extern void prom_console_write_buf(const char *buf, int len); extern void prom_console_write_buf(const char *buf, int len);
/* Prom's internal routines, don't use in kernel/boot code. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern void prom_printf(const char *fmt, ...); extern __printf(1, 2) void prom_printf(const char *fmt, ...);
extern void prom_write(const char *buf, unsigned int len); extern void prom_write(const char *buf, unsigned int len);
/* Multiprocessor operations... */ /* Multiprocessor operations... */
......
...@@ -98,7 +98,7 @@ extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); ...@@ -98,7 +98,7 @@ extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);
extern void prom_console_write_buf(const char *buf, int len); extern void prom_console_write_buf(const char *buf, int len);
/* Prom's internal routines, don't use in kernel/boot code. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern void prom_printf(const char *fmt, ...); extern __printf(1, 2) void prom_printf(const char *fmt, ...);
extern void prom_write(const char *buf, unsigned int len); extern void prom_write(const char *buf, unsigned int len);
/* Multiprocessor operations... */ /* Multiprocessor operations... */
......
...@@ -194,7 +194,7 @@ void __init sun4v_hvapi_init(void) ...@@ -194,7 +194,7 @@ void __init sun4v_hvapi_init(void)
bad: bad:
prom_printf("HVAPI: Cannot register API group " prom_printf("HVAPI: Cannot register API group "
"%lx with major(%u) minor(%u)\n", "%lx with major(%lu) minor(%lu)\n",
group, major, minor); group, major, minor);
prom_halt(); prom_halt();
} }
...@@ -37,7 +37,7 @@ void * __init prom_early_alloc(unsigned long size) ...@@ -37,7 +37,7 @@ void * __init prom_early_alloc(unsigned long size)
void *ret; void *ret;
if (!paddr) { if (!paddr) {
prom_printf("prom_early_alloc(%lu) failed\n"); prom_printf("prom_early_alloc(%lu) failed\n", size);
prom_halt(); prom_halt();
} }
......
...@@ -850,7 +850,7 @@ void __init cheetah_ecache_flush_init(void) ...@@ -850,7 +850,7 @@ void __init cheetah_ecache_flush_init(void)
ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size); ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size);
if (ecache_flush_physbase == ~0UL) { if (ecache_flush_physbase == ~0UL) {
prom_printf("cheetah_ecache_flush_init: Cannot find %d byte " prom_printf("cheetah_ecache_flush_init: Cannot find %ld byte "
"contiguous physical memory.\n", "contiguous physical memory.\n",
ecache_flush_size); ecache_flush_size);
prom_halt(); prom_halt();
......
...@@ -119,7 +119,8 @@ static void __init read_obp_memory(const char *property, ...@@ -119,7 +119,8 @@ static void __init read_obp_memory(const char *property,
ret = prom_getproperty(node, property, (char *) regs, prop_size); ret = prom_getproperty(node, property, (char *) regs, prop_size);
if (ret == -1) { if (ret == -1) {
prom_printf("Couldn't get %s property from /memory.\n"); prom_printf("Couldn't get %s property from /memory.\n",
property);
prom_halt(); prom_halt();
} }
...@@ -497,7 +498,7 @@ static void __init read_obp_translations(void) ...@@ -497,7 +498,7 @@ static void __init read_obp_translations(void)
prom_halt(); prom_halt();
} }
if (unlikely(n > sizeof(prom_trans))) { if (unlikely(n > sizeof(prom_trans))) {
prom_printf("prom_mappings: Size %Zd is too big.\n", n); prom_printf("prom_mappings: Size %d is too big.\n", n);
prom_halt(); prom_halt();
} }
...@@ -559,7 +560,7 @@ static void __init hypervisor_tlb_lock(unsigned long vaddr, ...@@ -559,7 +560,7 @@ static void __init hypervisor_tlb_lock(unsigned long vaddr,
unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu); unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu);
if (ret != 0) { if (ret != 0) {
prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: " prom_printf("hypervisor_tlb_lock[%lx:%x:%lx:%lx]: "
"errors with %lx\n", vaddr, 0, pte, mmu, ret); "errors with %lx\n", vaddr, 0, pte, mmu, ret);
prom_halt(); prom_halt();
} }
......
...@@ -90,8 +90,8 @@ static void __init sbus_iommu_init(struct platform_device *op) ...@@ -90,8 +90,8 @@ static void __init sbus_iommu_init(struct platform_device *op)
it to us. */ it to us. */
tmp = __get_free_pages(GFP_KERNEL, IOMMU_ORDER); tmp = __get_free_pages(GFP_KERNEL, IOMMU_ORDER);
if (!tmp) { if (!tmp) {
prom_printf("Unable to allocate iommu table [0x%08x]\n", prom_printf("Unable to allocate iommu table [0x%lx]\n",
IOMMU_NPTES*sizeof(iopte_t)); IOMMU_NPTES * sizeof(iopte_t));
prom_halt(); prom_halt();
} }
iommu->page_table = (iopte_t *)tmp; iommu->page_table = (iopte_t *)tmp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册