]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
m68k/kernel: Modernize printing of kernel messages
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 6 Dec 2016 18:57:37 +0000 (19:57 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 12 Feb 2017 09:36:52 +0000 (10:36 +0100)
  - 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: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/kernel/dma.c
arch/m68k/kernel/module.c
arch/m68k/kernel/process.c
arch/m68k/kernel/signal.c
arch/m68k/kernel/uboot.c

index 07070065a4256d6b237da811e552950d16e2e24c..1e4f386ba31e22bfe96182b7253b620504360077 100644 (file)
@@ -110,8 +110,8 @@ static void m68k_dma_sync_single_for_device(struct device *dev,
                cache_clear(handle, size);
                break;
        default:
-               if (printk_ratelimit())
-                       printk("dma_sync_single_for_device: unsupported dir %u\n", dir);
+               pr_err_ratelimited("dma_sync_single_for_device: unsupported dir %u\n",
+                                  dir);
                break;
        }
 }
index eb46fd6038cac73ab3b94b55d7c8e321f8b9ff00..aaac2da318ffd37751501fc80c79d90bdd4a7d68 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/kernel.h>
 
 #if 0
-#define DEBUGP printk
+#define DEBUGP(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 #else
-#define DEBUGP(fmt...)
+#define DEBUGP(fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 #endif
 
 #ifdef CONFIG_MODULES
@@ -51,8 +51,8 @@ int apply_relocate(Elf32_Shdr *sechdrs,
                        *location += sym->st_value - (uint32_t)location;
                        break;
                default:
-                       printk(KERN_ERR "module %s: Unknown relocation: %u\n",
-                              me->name, ELF32_R_TYPE(rel[i].r_info));
+                       pr_err("module %s: Unknown relocation: %u\n", me->name,
+                              ELF32_R_TYPE(rel[i].r_info));
                        return -ENOEXEC;
                }
        }
@@ -91,8 +91,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
                        *location = rel[i].r_addend + sym->st_value - (uint32_t)location;
                        break;
                default:
-                       printk(KERN_ERR "module %s: Unknown relocation: %u\n",
-                              me->name, ELF32_R_TYPE(rel[i].r_info));
+                       pr_err("module %s: Unknown relocation: %u\n", me->name,
+                              ELF32_R_TYPE(rel[i].r_info));
                        return -ENOEXEC;
                }
        }
index aaf28f8e342d27885f6dcbdca74d8f11b43d23af..f0a8e9b332cda75202b663b8ce81949c718c80da 100644 (file)
@@ -87,17 +87,17 @@ EXPORT_SYMBOL(pm_power_off);
 
 void show_regs(struct pt_regs * regs)
 {
-       printk("\n");
-       printk("Format %02x  Vector: %04x  PC: %08lx  Status: %04x    %s\n",
-              regs->format, regs->vector, regs->pc, regs->sr, print_tainted());
-       printk("ORIG_D0: %08lx  D0: %08lx  A2: %08lx  A1: %08lx\n",
-              regs->orig_d0, regs->d0, regs->a2, regs->a1);
-       printk("A0: %08lx  D5: %08lx  D4: %08lx\n",
-              regs->a0, regs->d5, regs->d4);
-       printk("D3: %08lx  D2: %08lx  D1: %08lx\n",
-              regs->d3, regs->d2, regs->d1);
+       pr_info("Format %02x  Vector: %04x  PC: %08lx  Status: %04x    %s\n",
+               regs->format, regs->vector, regs->pc, regs->sr,
+               print_tainted());
+       pr_info("ORIG_D0: %08lx  D0: %08lx  A2: %08lx  A1: %08lx\n",
+               regs->orig_d0, regs->d0, regs->a2, regs->a1);
+       pr_info("A0: %08lx  D5: %08lx  D4: %08lx\n", regs->a0, regs->d5,
+               regs->d4);
+       pr_info("D3: %08lx  D2: %08lx  D1: %08lx\n", regs->d3, regs->d2,
+               regs->d1);
        if (!(regs->sr & PS_S))
-               printk("USP: %08lx\n", rdusp());
+               pr_info("USP: %08lx\n", rdusp());
 }
 
 void flush_thread(void)
index 8ead291a902a346765fe995eee1e39ad1171e542..093b7c42fb85ae82c673cd93c71bf3f16e7123f2 100644 (file)
@@ -598,9 +598,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
                /*
                 * user process trying to return with weird frame format
                 */
-#ifdef DEBUG
-               printk("user process returning with weird frame format\n");
-#endif
+               pr_debug("user process returning with weird frame format\n");
                return 1;
        }
        if (!fsize) {
@@ -846,10 +844,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
        int err = 0, sig = ksig->sig;
 
        if (fsize < 0) {
-#ifdef DEBUG
-               printk ("setup_frame: Unknown frame format %#x\n",
-                       regs->format);
-#endif
+               pr_debug("setup_frame: Unknown frame format %#x\n",
+                        regs->format);
                return -EFAULT;
        }
 
@@ -905,9 +901,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
        if (regs->stkadj) {
                struct pt_regs *tregs =
                        (struct pt_regs *)((ulong)regs + regs->stkadj);
-#ifdef DEBUG
-               printk("Performing stackadjust=%04x\n", regs->stkadj);
-#endif
+               pr_debug("Performing stackadjust=%04lx\n", regs->stkadj);
                /* This must be copied with decreasing addresses to
                    handle overlaps.  */
                tregs->vector = 0;
@@ -926,10 +920,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
        int err = 0, sig = ksig->sig;
 
        if (fsize < 0) {
-#ifdef DEBUG
-               printk ("setup_frame: Unknown frame format %#x\n",
-                       regs->format);
-#endif
+               pr_debug("setup_frame: Unknown frame format %#x\n",
+                        regs->format);
                return -EFAULT;
        }
 
@@ -993,9 +985,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
        if (regs->stkadj) {
                struct pt_regs *tregs =
                        (struct pt_regs *)((ulong)regs + regs->stkadj);
-#ifdef DEBUG
-               printk("Performing stackadjust=%04x\n", regs->stkadj);
-#endif
+               pr_debug("Performing stackadjust=%04lx\n", regs->stkadj);
                /* This must be copied with decreasing addresses to
                    handle overlaps.  */
                tregs->vector = 0;
index b3536a82a26202b65d81b4c9d2cffc068c3a22c9..b29c3b241e1bb590eba500918e39e4ce9bc59796 100644 (file)
@@ -83,8 +83,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
                initrd_start = uboot_initrd_start;
                initrd_end = uboot_initrd_end;
                ROOT_DEV = Root_RAM0;
-               printk(KERN_INFO "initrd at 0x%lx:0x%lx\n",
-                       initrd_start, initrd_end);
+               pr_info("initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
        }
 #endif /* if defined(CONFIG_BLK_DEV_INITRD) */
 }