mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: apw@canonical.com, linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: don't warn for space after for_each_* macros
Date: Mon, 31 May 2010 17:03:32 +0200	[thread overview]
Message-ID: <20100531150332.GA18341@basil.fritz.box> (raw)

checkpatch: don't warn for space after for_each_* macros

for_each_possible_cpu and similar macros act like loops and it's natural
for them to be written like while () with a space before the paren.

Unfortunately checkpatch.pl warns about this:

WARNING: space prohibited between function name and open parenthesis '('
+       for_each_possible_cpu (cpu) {

Don't warn for all function names matching a reasonable for_each pattern.
    
 Signed-off-by: Andi Kleen <ak@linux.intel.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd88f11..c35eda2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1906,6 +1906,7 @@ sub process {
 				if|for|while|switch|return|case|
 				volatile|__volatile__|
 				__attribute__|format|__extension__|
+				([a-z]+_)?for_each_[a-z_]+|
 				asm|__asm__)$/x)
 			{
 

                 reply	other threads:[~2010-05-31 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100531150332.GA18341@basil.fritz.box \
    --to=andi@firstfloor.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome