Skip to content

Commit

Permalink
kernel/signal.c: fix suboptimal printk usage
Browse files Browse the repository at this point in the history
Several printk's were missing KERN_INFO and KERN_CONT flags.  In
addition, a printk that was outside a #if/#endif should have been
inside, which would result in stray blank line on non-x86 boxes.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Valdis Kletnieks authored and Linus Torvalds committed Feb 28, 2013
1 parent 66dd34a commit 5d1fadc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,23 +1157,23 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
static void print_fatal_signal(int signr)
{
struct pt_regs *regs = signal_pt_regs();
printk("%s/%d: potentially unexpected fatal signal %d.\n",
printk(KERN_INFO "%s/%d: potentially unexpected fatal signal %d.\n",
current->comm, task_pid_nr(current), signr);

#if defined(__i386__) && !defined(__arch_um__)
printk("code at %08lx: ", regs->ip);
printk(KERN_INFO "code at %08lx: ", regs->ip);
{
int i;
for (i = 0; i < 16; i++) {
unsigned char insn;

if (get_user(insn, (unsigned char *)(regs->ip + i)))
break;
printk("%02x ", insn);
printk(KERN_CONT "%02x ", insn);
}
}
printk(KERN_CONT "\n");
#endif
printk("\n");
preempt_disable();
show_regs(regs);
preempt_enable();
Expand Down

0 comments on commit 5d1fadc

Please sign in to comment.