From: Ingo Molnar <mingo@elte.hu>
To: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Yinghai Lu <yhlu.kernel@gmail.com>
Subject: Re: [GIT PULL] percpu fixes for 2.6.32-rc6
Date: Thu, 12 Nov 2009 12:25:44 +0100 [thread overview]
Message-ID: <20091112112544.GD24684@elte.hu> (raw)
In-Reply-To: <4AFBEA4B.4070100@kernel.org>
* Tejun Heo <tj@kernel.org> wrote:
> This really depends on personal tastes. When trying to use long
> string literals, there are several choices.
>
> 1. Use broken strings.
>
> printk("blah blah blah blah "
> "blah blah blah blah\n");
>
> 2. Push it into new line and unindent it.
>
> printk(
> "blah blah blah blah blah blah blah blah\n");
>
> 3. Restructure code so that the literal ends up in outer block.
>
> printk("blah blah blah blah blah blah blah blah\n");
>
> I prefer the first choice. The third would be nice if it's trivial to
> do but I don't think it should dictate the code structure. The second
> one, I don't know. Some people like that and grep will be happy with
> it but it just seems very disturbing to my eyes.
My preferred choice is:
4. Change "blah blah blah blah blah blah blah blah\n" to "blah\n" -
the user really does not win much from the repetition.
Seriously, if you _ever_ get into a 'hm, the string is too long'
situation, you should ask yourself two fundamental questions:
a) Is the user really interested in this small novel?
b) Is this a side-effect of a bloated function having too deep
indentation?
IMHO, in the specific case at hand, both a) and b) apply:
err = "failed to extend area map of "
"reserved chunk";
the indentation is a bit too deep, and the message is too chatty - the
output itself is:
PERCPU: allocation failed, size=1024 align=32, failed to extend area map of reserved chunk
A better/shorter message would be:
percpu: 1024 bytes allocation failed: could not extend reserved chunk area map
This formulation is a bit shorter and i doubt the align parameter really
needs printing - it's almost always the same and other context will tell
us what it is anyway.
Ingo
next prev parent reply other threads:[~2009-11-12 11:25 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 6:04 [GIT PULL] percpu fixes for 2.6.32-rc6 Tejun Heo
2009-11-10 17:10 ` Linus Torvalds
2009-11-10 18:33 ` Tejun Heo
2009-11-10 18:54 ` Linus Torvalds
2009-11-10 19:25 ` Tejun Heo
2009-11-10 19:37 ` Ingo Molnar
2009-11-10 19:50 ` Tejun Heo
2009-11-10 21:42 ` Linus Torvalds
2009-11-11 3:55 ` Tejun Heo
2009-11-11 11:31 ` Ingo Molnar
2009-11-11 12:21 ` Tejun Heo
2009-11-11 19:57 ` Ingo Molnar
2009-11-12 10:11 ` Tejun Heo
2009-11-12 10:36 ` Ingo Molnar
2009-11-12 10:58 ` Tejun Heo
2009-11-12 11:25 ` Ingo Molnar [this message]
2009-11-12 14:26 ` Oliver Neukum
2009-11-12 15:17 ` Linus Torvalds
2009-11-12 15:30 ` Tejun Heo
2009-11-12 15:45 ` Tejun Heo
2009-11-12 15:52 ` Linus Torvalds
2009-11-12 17:04 ` Andres Baldrich
2009-11-12 17:18 ` Linus Torvalds
2009-11-12 18:04 ` Ingo Molnar
2009-11-12 18:14 ` Andi Kleen
2009-11-12 11:07 ` Ingo Molnar
2009-11-12 11:29 ` Tejun Heo
2009-11-11 8:49 ` [PATCH percpu#for-linus] percpu: restructure pcpu_extend_area_map() to fix bugs and improve readability Tejun Heo
2009-11-11 19:25 ` Linus Torvalds
2009-11-10 19:44 ` [GIT PULL] percpu fixes for 2.6.32-rc6 Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2009-11-13 3:53 Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091112112544.GD24684@elte.hu \
--to=mingo@elte.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yhlu.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox