Messages in this thread |  | | | Date | Thu, 2 Jul 2009 10:27:50 -0700 (PDT) | | From | Linus Torvalds <> | | Subject | Re: printk regression? |
On Wed, 1 Jul 2009, Joe Perches wrote: > > There's at least 72 of them: > > $ grep -Pr --include=*.[ch] "\bprintk.*\\\n.*KERN_" *
Yes. Most of these seem to be of the type that have just "\n" in front - probably exactly because the old code wasn't smart enough to notice the log-level unless it started a line.
For those cases, the trivial fix is to just remove the "\n". The new world order for printk is very much a simplification: the log-level is _always_ at the front of the printk, and printk will add the newline automatically if a log-level exists (unless it's KERN_CONT, of course).
So a simple
sed 's/printk("\n"[ ]*KERN_/printk(KERN_/'
should basically take care of it.
Of course, some cases are just crazy. Here's one:
arch/m68knommu/kernel/traps.c: printk(KERN_CONT "\n" KERN_EMERG " [%08lx] ", addr);
and I have no clue about why it would have KERN_CONT there. That makes little sense. Again, with the new printk logic, it really should be just
printk(KERN_EMERG " [%08lx] ", addr);
and nothing odd.
Linus
|  |