Commit 7c79e1ee authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

m68k/kernel: Modernize printing of kernel messages

  - Use pr_err_ratelimited() instead of deprecated printk_ratelimit(),
  - Add dummies for validating format strings when debugging is
    disabled,
  - Convert from printk() to pr_*(),
  - Correct printf()-style format specifiers.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 4eee1e72
...@@ -110,8 +110,8 @@ static void m68k_dma_sync_single_for_device(struct device *dev, ...@@ -110,8 +110,8 @@ static void m68k_dma_sync_single_for_device(struct device *dev,
cache_clear(handle, size); cache_clear(handle, size);
break; break;
default: default:
if (printk_ratelimit()) pr_err_ratelimited("dma_sync_single_for_device: unsupported dir %u\n",
printk("dma_sync_single_for_device: unsupported dir %u\n", dir); dir);
break; break;
} }
} }
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#if 0 #if 0
#define DEBUGP printk #define DEBUGP(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#else #else
#define DEBUGP(fmt...) #define DEBUGP(fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#endif #endif
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
...@@ -51,8 +51,8 @@ int apply_relocate(Elf32_Shdr *sechdrs, ...@@ -51,8 +51,8 @@ int apply_relocate(Elf32_Shdr *sechdrs,
*location += sym->st_value - (uint32_t)location; *location += sym->st_value - (uint32_t)location;
break; break;
default: default:
printk(KERN_ERR "module %s: Unknown relocation: %u\n", pr_err("module %s: Unknown relocation: %u\n", me->name,
me->name, ELF32_R_TYPE(rel[i].r_info)); ELF32_R_TYPE(rel[i].r_info));
return -ENOEXEC; return -ENOEXEC;
} }
} }
...@@ -91,8 +91,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -91,8 +91,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
*location = rel[i].r_addend + sym->st_value - (uint32_t)location; *location = rel[i].r_addend + sym->st_value - (uint32_t)location;
break; break;
default: default:
printk(KERN_ERR "module %s: Unknown relocation: %u\n", pr_err("module %s: Unknown relocation: %u\n", me->name,
me->name, ELF32_R_TYPE(rel[i].r_info)); ELF32_R_TYPE(rel[i].r_info));
return -ENOEXEC; return -ENOEXEC;
} }
} }
......
...@@ -87,17 +87,17 @@ EXPORT_SYMBOL(pm_power_off); ...@@ -87,17 +87,17 @@ EXPORT_SYMBOL(pm_power_off);
void show_regs(struct pt_regs * regs) void show_regs(struct pt_regs * regs)
{ {
printk("\n"); pr_info("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n",
printk("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n", regs->format, regs->vector, regs->pc, regs->sr,
regs->format, regs->vector, regs->pc, regs->sr, print_tainted()); print_tainted());
printk("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n", pr_info("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n",
regs->orig_d0, regs->d0, regs->a2, regs->a1); regs->orig_d0, regs->d0, regs->a2, regs->a1);
printk("A0: %08lx D5: %08lx D4: %08lx\n", pr_info("A0: %08lx D5: %08lx D4: %08lx\n", regs->a0, regs->d5,
regs->a0, regs->d5, regs->d4); regs->d4);
printk("D3: %08lx D2: %08lx D1: %08lx\n", pr_info("D3: %08lx D2: %08lx D1: %08lx\n", regs->d3, regs->d2,
regs->d3, regs->d2, regs->d1); regs->d1);
if (!(regs->sr & PS_S)) if (!(regs->sr & PS_S))
printk("USP: %08lx\n", rdusp()); pr_info("USP: %08lx\n", rdusp());
} }
void flush_thread(void) void flush_thread(void)
......
...@@ -598,9 +598,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec, ...@@ -598,9 +598,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
/* /*
* user process trying to return with weird frame format * user process trying to return with weird frame format
*/ */
#ifdef DEBUG pr_debug("user process returning with weird frame format\n");
printk("user process returning with weird frame format\n");
#endif
return 1; return 1;
} }
if (!fsize) { if (!fsize) {
...@@ -846,10 +844,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, ...@@ -846,10 +844,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
int err = 0, sig = ksig->sig; int err = 0, sig = ksig->sig;
if (fsize < 0) { if (fsize < 0) {
#ifdef DEBUG pr_debug("setup_frame: Unknown frame format %#x\n",
printk ("setup_frame: Unknown frame format %#x\n", regs->format);
regs->format);
#endif
return -EFAULT; return -EFAULT;
} }
...@@ -905,9 +901,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, ...@@ -905,9 +901,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
if (regs->stkadj) { if (regs->stkadj) {
struct pt_regs *tregs = struct pt_regs *tregs =
(struct pt_regs *)((ulong)regs + regs->stkadj); (struct pt_regs *)((ulong)regs + regs->stkadj);
#ifdef DEBUG pr_debug("Performing stackadjust=%04lx\n", regs->stkadj);
printk("Performing stackadjust=%04x\n", regs->stkadj);
#endif
/* This must be copied with decreasing addresses to /* This must be copied with decreasing addresses to
handle overlaps. */ handle overlaps. */
tregs->vector = 0; tregs->vector = 0;
...@@ -926,10 +920,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -926,10 +920,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
int err = 0, sig = ksig->sig; int err = 0, sig = ksig->sig;
if (fsize < 0) { if (fsize < 0) {
#ifdef DEBUG pr_debug("setup_frame: Unknown frame format %#x\n",
printk ("setup_frame: Unknown frame format %#x\n", regs->format);
regs->format);
#endif
return -EFAULT; return -EFAULT;
} }
...@@ -993,9 +985,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -993,9 +985,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
if (regs->stkadj) { if (regs->stkadj) {
struct pt_regs *tregs = struct pt_regs *tregs =
(struct pt_regs *)((ulong)regs + regs->stkadj); (struct pt_regs *)((ulong)regs + regs->stkadj);
#ifdef DEBUG pr_debug("Performing stackadjust=%04lx\n", regs->stkadj);
printk("Performing stackadjust=%04x\n", regs->stkadj);
#endif
/* This must be copied with decreasing addresses to /* This must be copied with decreasing addresses to
handle overlaps. */ handle overlaps. */
tregs->vector = 0; tregs->vector = 0;
......
...@@ -83,8 +83,7 @@ static void __init parse_uboot_commandline(char *commandp, int size) ...@@ -83,8 +83,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
initrd_start = uboot_initrd_start; initrd_start = uboot_initrd_start;
initrd_end = uboot_initrd_end; initrd_end = uboot_initrd_end;
ROOT_DEV = Root_RAM0; ROOT_DEV = Root_RAM0;
printk(KERN_INFO "initrd at 0x%lx:0x%lx\n", pr_info("initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
initrd_start, initrd_end);
} }
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ #endif /* if defined(CONFIG_BLK_DEV_INITRD) */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment