Skip to content

Commit

Permalink
Remove multiple KERN_ prefixes from printk formats
Browse files Browse the repository at this point in the history
Commit 5fd29d6 ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.

<level> is now included in the output on each additional use.

Remove all uses of multiple KERN_<level>s in formats.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Jul 8, 2009
1 parent e328877 commit ad361c9
Show file tree
Hide file tree
Showing 70 changed files with 330 additions and 338 deletions.
13 changes: 8 additions & 5 deletions arch/avr32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,25 @@ void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
spin_lock_irq(&die_lock);
bust_spinlocks(1);

printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n" KERN_EMERG,
printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n",
str, err, ++die_counter);

printk(KERN_EMERG);

#ifdef CONFIG_PREEMPT
printk("PREEMPT ");
printk(KERN_CONT "PREEMPT ");
#endif
#ifdef CONFIG_FRAME_POINTER
printk("FRAME_POINTER ");
printk(KERN_CONT "FRAME_POINTER ");
#endif
if (current_cpu_data.features & AVR32_FEATURE_OCD) {
unsigned long did = ocd_read(DID);
printk("chip: 0x%03lx:0x%04lx rev %lu\n",
printk(KERN_CONT "chip: 0x%03lx:0x%04lx rev %lu\n",
(did >> 1) & 0x7ff,
(did >> 12) & 0x7fff,
(did >> 28) & 0xf);
} else {
printk("cpu: arch %u r%u / core %u r%u\n",
printk(KERN_CONT "cpu: arch %u r%u / core %u r%u\n",
current_cpu_data.arch_type,
current_cpu_data.arch_revision,
current_cpu_data.cpu_type,
Expand Down
41 changes: 21 additions & 20 deletions arch/blackfin/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,14 @@ static void __init print_memory_map(char *who)
bfin_memmap.map[i].addr + bfin_memmap.map[i].size);
switch (bfin_memmap.map[i].type) {
case BFIN_MEMMAP_RAM:
printk("(usable)\n");
break;
printk(KERN_CONT "(usable)\n");
break;
case BFIN_MEMMAP_RESERVED:
printk("(reserved)\n");
break;
default: printk("type %lu\n", bfin_memmap.map[i].type);
break;
printk(KERN_CONT "(reserved)\n");
break;
default:
printk(KERN_CONT "type %lu\n", bfin_memmap.map[i].type);
break;
}
}
}
Expand Down Expand Up @@ -614,19 +615,19 @@ static __init void memory_setup(void)
printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);

printk(KERN_INFO "Memory map:\n"
KERN_INFO " fixedcode = 0x%p-0x%p\n"
KERN_INFO " text = 0x%p-0x%p\n"
KERN_INFO " rodata = 0x%p-0x%p\n"
KERN_INFO " bss = 0x%p-0x%p\n"
KERN_INFO " data = 0x%p-0x%p\n"
KERN_INFO " stack = 0x%p-0x%p\n"
KERN_INFO " init = 0x%p-0x%p\n"
KERN_INFO " available = 0x%p-0x%p\n"
" fixedcode = 0x%p-0x%p\n"
" text = 0x%p-0x%p\n"
" rodata = 0x%p-0x%p\n"
" bss = 0x%p-0x%p\n"
" data = 0x%p-0x%p\n"
" stack = 0x%p-0x%p\n"
" init = 0x%p-0x%p\n"
" available = 0x%p-0x%p\n"
#ifdef CONFIG_MTD_UCLINUX
KERN_INFO " rootfs = 0x%p-0x%p\n"
" rootfs = 0x%p-0x%p\n"
#endif
#if DMA_UNCACHED_REGION > 0
KERN_INFO " DMA Zone = 0x%p-0x%p\n"
" DMA Zone = 0x%p-0x%p\n"
#endif
, (void *)FIXED_CODE_START, (void *)FIXED_CODE_END,
_stext, _etext,
Expand Down Expand Up @@ -859,13 +860,13 @@ void __init setup_arch(char **cmdline_p)
#endif
printk(KERN_INFO "Hardware Trace ");
if (bfin_read_TBUFCTL() & 0x1)
printk("Active ");
printk(KERN_CONT "Active ");
else
printk("Off ");
printk(KERN_CONT "Off ");
if (bfin_read_TBUFCTL() & 0x2)
printk("and Enabled\n");
printk(KERN_CONT "and Enabled\n");
else
printk("and Disabled\n");
printk(KERN_CONT "and Disabled\n");

#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
/* we need to initialize the Flashrom device here since we might
Expand Down
34 changes: 17 additions & 17 deletions arch/blackfin/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
console_verbose();
oops_in_progress = 1;
#ifdef CONFIG_DEBUG_VERBOSE
printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
printk(KERN_EMERG "Double Fault\n");
#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
unsigned int cpu = smp_processor_id();
Expand Down Expand Up @@ -583,15 +583,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
verbose_printk(KERN_NOTICE "No trace since you do not have "
"CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n"
KERN_NOTICE "\n");
"CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n\n");
else
#endif
dump_bfin_trace_buffer();

if (oops_in_progress) {
/* Dump the current kernel stack */
verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "Kernel Stack\n");
verbose_printk(KERN_NOTICE "Kernel Stack\n");
show_stack(current, NULL);
print_modules();
#ifndef CONFIG_ACCESS_CHECK
Expand Down Expand Up @@ -906,7 +905,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)

ret_addr = 0;
if (!j && i % 8 == 0)
printk("\n" KERN_NOTICE "%p:",addr);
printk(KERN_NOTICE "%p:",addr);

/* if it is an odd address, or zero, just skip it */
if (*addr & 0x1 || !*addr)
Expand Down Expand Up @@ -996,9 +995,9 @@ void dump_bfin_process(struct pt_regs *fp)

printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu);
if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START)
verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n"
KERN_NOTICE "\n",
verbose_printk(KERN_NOTICE
"TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
" BSS = 0x%p-0x%p USER-STACK = 0x%p\n\n",
(void *)current->mm->start_code,
(void *)current->mm->end_code,
(void *)current->mm->start_data,
Expand All @@ -1009,8 +1008,8 @@ void dump_bfin_process(struct pt_regs *fp)
else
verbose_printk(KERN_NOTICE "invalid mm\n");
} else
verbose_printk(KERN_NOTICE "\n" KERN_NOTICE
"No Valid process in current context\n");
verbose_printk(KERN_NOTICE
"No Valid process in current context\n");
#endif
}

Expand All @@ -1028,7 +1027,7 @@ void dump_bfin_mem(struct pt_regs *fp)
addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10;
addr++) {
if (!((unsigned long)addr & 0xF))
verbose_printk("\n" KERN_NOTICE "0x%p: ", addr);
verbose_printk(KERN_NOTICE "0x%p: ", addr);

if (!get_instruction(&val, addr)) {
val = 0;
Expand Down Expand Up @@ -1056,9 +1055,9 @@ void dump_bfin_mem(struct pt_regs *fp)
oops_in_progress)){
verbose_printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n");
#ifndef CONFIG_DEBUG_HWERR
verbose_printk(KERN_NOTICE "The remaining message may be meaningless\n"
KERN_NOTICE "You should enable CONFIG_DEBUG_HWERR to get a"
" better idea where it came from\n");
verbose_printk(KERN_NOTICE
"The remaining message may be meaningless\n"
"You should enable CONFIG_DEBUG_HWERR to get a better idea where it came from\n");
#else
/* If we are handling only one peripheral interrupt
* and current mm and pid are valid, and the last error
Expand Down Expand Up @@ -1114,9 +1113,10 @@ void show_regs(struct pt_regs *fp)

verbose_printk(KERN_NOTICE "%s", linux_banner);

verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted());
verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n",
print_tainted());
verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
(long)fp->seqstat, fp->ipend, fp->syscfg);
(long)fp->seqstat, fp->ipend, fp->syscfg);
if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) {
verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
(fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14);
Expand Down Expand Up @@ -1184,7 +1184,7 @@ void show_regs(struct pt_regs *fp)
verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
}

verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "PROCESSOR STATE:\n");
verbose_printk(KERN_NOTICE "PROCESSOR STATE:\n");
verbose_printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
fp->r0, fp->r1, fp->r2, fp->r3);
verbose_printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
Expand Down
21 changes: 10 additions & 11 deletions arch/m68knommu/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void dump(struct pt_regs *fp)
unsigned char *tp;
int i;

printk(KERN_EMERG "\n" KERN_EMERG "CURRENT PROCESS:\n" KERN_EMERG "\n");
printk(KERN_EMERG "\nCURRENT PROCESS:\n\n");
printk(KERN_EMERG "COMM=%s PID=%d\n", current->comm, current->pid);

if (current->mm) {
Expand All @@ -301,8 +301,7 @@ void dump(struct pt_regs *fp)
(int) current->mm->end_data,
(int) current->mm->end_data,
(int) current->mm->brk);
printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n"
KERN_EMERG "\n",
printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n\n",
(int) current->mm->start_stack,
(int)(((unsigned long) current) + THREAD_SIZE));
}
Expand All @@ -313,35 +312,35 @@ void dump(struct pt_regs *fp)
fp->d0, fp->d1, fp->d2, fp->d3);
printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
fp->d4, fp->d5, fp->a0, fp->a1);
printk(KERN_EMERG "\n" KERN_EMERG "USP: %08x TRAPFRAME: %08x\n",
printk(KERN_EMERG "\nUSP: %08x TRAPFRAME: %08x\n",
(unsigned int) rdusp(), (unsigned int) fp);

printk(KERN_EMERG "\n" KERN_EMERG "CODE:");
printk(KERN_EMERG "\nCODE:");
tp = ((unsigned char *) fp->pc) - 0x20;
for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) {
if ((i % 0x10) == 0)
printk("\n" KERN_EMERG "%08x: ", (int) (tp + i));
printk(KERN_EMERG "%08x: ", (int) (tp + i));
printk("%08x ", (int) *sp++);
}
printk("\n" KERN_EMERG "\n");
printk(KERN_EMERG "\n");

printk(KERN_EMERG "KERNEL STACK:");
tp = ((unsigned char *) fp) - 0x40;
for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) {
if ((i % 0x10) == 0)
printk("\n" KERN_EMERG "%08x: ", (int) (tp + i));
printk(KERN_EMERG "%08x: ", (int) (tp + i));
printk("%08x ", (int) *sp++);
}
printk("\n" KERN_EMERG "\n");
printk(KERN_EMERG "\n");

printk(KERN_EMERG "USER STACK:");
tp = (unsigned char *) (rdusp() - 0x10);
for (sp = (unsigned long *) tp, i = 0; (i < 0x80); i += 4) {
if ((i % 0x10) == 0)
printk("\n" KERN_EMERG "%08x: ", (int) (tp + i));
printk(KERN_EMERG "%08x: ", (int) (tp + i));
printk("%08x ", (int) *sp++);
}
printk("\n" KERN_EMERG "\n");
printk(KERN_EMERG "\n");
}

/*
Expand Down
6 changes: 3 additions & 3 deletions arch/m68knommu/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static void print_this_address(unsigned long addr, int i)
if (i % 5)
printk(KERN_CONT " [%08lx] ", addr);
else
printk(KERN_CONT "\n" KERN_EMERG " [%08lx] ", addr);
printk(KERN_EMERG " [%08lx] ", addr);
i++;
#endif
}
Expand All @@ -137,8 +137,8 @@ static void __show_stack(struct task_struct *task, unsigned long *stack)
if (stack + 1 + i > endstack)
break;
if (i % 8 == 0)
printk("\n" KERN_EMERG " ");
printk(" %08lx", *(stack + i));
printk(KERN_EMERG " ");
printk(KERN_CONT " %08lx", *(stack + i));
}
printk("\n");
i = 0;
Expand Down
21 changes: 8 additions & 13 deletions arch/mn10300/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ void show_trace(unsigned long *sp)
unsigned long *stack, addr, module_start, module_end;
int i;

printk(KERN_EMERG "\n"
KERN_EMERG "Call Trace:");
printk(KERN_EMERG "\nCall Trace:");

stack = sp;
i = 0;
Expand All @@ -153,7 +152,7 @@ void show_trace(unsigned long *sp)
printk("\n");
#else
if ((i % 6) == 0)
printk("\n" KERN_EMERG " ");
printk(KERN_EMERG " ");
printk("[<%08lx>] ", addr);
i++;
#endif
Expand All @@ -180,7 +179,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
if (((long) stack & (THREAD_SIZE - 1)) == 0)
break;
if ((i % 8) == 0)
printk("\n" KERN_EMERG " ");
printk(KERN_EMERG " ");
printk("%08lx ", *stack++);
}

Expand Down Expand Up @@ -264,8 +263,7 @@ void show_registers(struct pt_regs *regs)
show_stack(current, (unsigned long *) sp);

#if 0
printk(KERN_EMERG "\n"
KERN_EMERG "Code: ");
printk(KERN_EMERG "\nCode: ");
if (regs->pc < PAGE_OFFSET)
goto bad;

Expand Down Expand Up @@ -311,16 +309,14 @@ void die(const char *str, struct pt_regs *regs, enum exception_code code)
{
console_verbose();
spin_lock_irq(&die_lock);
printk(KERN_EMERG "\n"
KERN_EMERG "%s: %04x\n",
printk(KERN_EMERG "\n%s: %04x\n",
str, code & 0xffff);
show_registers(regs);

if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 &&
(regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) {
printk(KERN_EMERG "Exception in usermode interrupt handler\n");
printk(KERN_EMERG "\n"
KERN_EMERG " Please connect to kernel debugger !!\n");
printk(KERN_EMERG "\nPlease connect to kernel debugger !!\n");
asm volatile ("0: bra 0b");
}

Expand Down Expand Up @@ -429,9 +425,8 @@ asmlinkage void io_bus_error(u32 bcberr, u32 bcbear, struct pt_regs *regs)
{
console_verbose();

printk(KERN_EMERG "\n"
KERN_EMERG "Asynchronous I/O Bus Error\n"
KERN_EMERG "==========================\n");
printk(KERN_EMERG "Asynchronous I/O Bus Error\n");
printk(KERN_EMERG "==========================\n");

if (bcberr & BCBERR_BEME)
printk(KERN_EMERG "- Multiple recorded errors\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void machine_power_off(void)
* software. The user has to press the button himself. */

printk(KERN_EMERG "System shut down completed.\n"
KERN_EMERG "Please power this system off now.");
"Please power this system off now.");
}

void (*pm_power_off)(void) = machine_power_off;
Expand Down
20 changes: 10 additions & 10 deletions arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,14 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
oops_enter();

/* Amuse the user in a SPARC fashion */
if (err) printk(
KERN_CRIT " _______________________________ \n"
KERN_CRIT " < Your System ate a SPARC! Gah! >\n"
KERN_CRIT " ------------------------------- \n"
KERN_CRIT " \\ ^__^\n"
KERN_CRIT " \\ (xx)\\_______\n"
KERN_CRIT " (__)\\ )\\/\\\n"
KERN_CRIT " U ||----w |\n"
KERN_CRIT " || ||\n");
if (err) printk(KERN_CRIT
" _______________________________ \n"
" < Your System ate a SPARC! Gah! >\n"
" ------------------------------- \n"
" \\ ^__^\n"
" (__)\\ )\\/\\\n"
" U ||----w |\n"
" || ||\n");

/* unlock the pdc lock if necessary */
pdc_emergency_unlock();
Expand Down Expand Up @@ -797,7 +796,8 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
else
printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ",
code);
printk("pid=%d command='%s'\n", task_pid_nr(current), current->comm);
printk(KERN_CONT "pid=%d command='%s'\n",
task_pid_nr(current), current->comm);
show_regs(regs);
#endif
si.si_signo = SIGSEGV;
Expand Down
Loading

0 comments on commit ad361c9

Please sign in to comment.