[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=VB5po9Yt2oCcCq01UNQxXNY+_6RBpjWRFkvxN@mail.gmail.com>
Date: Tue, 1 Mar 2011 13:46:52 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: linux-kernel@...r.kernel.org,
Russell King - ARM Linux <linux@....linux.org.uk>,
kernel@...gutronix.de, Arjan van de Ven <arjan@...radead.org>,
linux-mm@...ck.org
Subject: Re: [PATCH 5/6] mm: add some KERN_CONT markers to continuation lines
2011/2/28 Uwe Kleine-König <u.kleine-koenig@...gutronix.de>:
> Hello,
>
>
> On Wed, Nov 24, 2010 at 09:57:49AM +0100, Uwe Kleine-König wrote:
>> - printk("\n");
>> - printk("%spcpu-alloc: ", lvl);
>> + printk(KERN_CONT "\n");
>> + printk("%spcpu-alloc:", lvl);
So I hate this kind of "mindless search-and-replace" patch.
The whole point is that with the modern printk semantics, the above
kind of crazy cdoe shouldn't be needed. You should be able to just
write
printk("%spcpu-alloc:", lvl);
without that "\n" at all, because printk() will insert the \n if
necessary. So the concept of
printk(KERN_CONT "\n")
is just crazy: you're saying "I want to continue the line, in order to
print a newline". Whaa?
>> - printk("[%0*d] ", group_width, group);
>> + printk(KERN_CONT " [%0*d]", group_width, group);
>> - printk("%0*d ", cpu_width,
>> + printk(KERN_CONT " %0*d", cpu_width,
>> - printk("%s ", empty_str);
>> + printk(KERN_CONT " %s", empty_str);
These look ok, but:
>> - printk("\n");
>> + printk(KERN_CONT "\n");
Same deal. Why do KERN_CONT + "\n"?
Yes, yes, it does have semantic meaning ("do newline _now_"), and can
matter if you are going to use KERN_CONT exclusively around it. But it
still smells like just being silly to me. The point of the printk
changes was to make things simpler. I really would suggest just
removing those KERN_CONT "\n" lines. Doesn't it end up looking fine
that way too?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists