public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: apw@shadowen.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Handle space after for_each_* macros gracefully in checkpatch
Date: Fri, 24 Oct 2008 13:50:10 +0200	[thread overview]
Message-ID: <20081024115010.GA31761@basil.nowhere.org> (raw)

Handle space after for_each_* macros gracefully in checkpatch.pl

Anyone else seeing the irony of checkpatch.pl recommending to 
use for_each_cpu_mask, but then not actually parsing it
correctly.

When you write 

	for_each_cpu_mask (...) { 

it would complain about the space between mask and the open bracket
because it thinks it's a normal function call.

Fix this in a generic way. In theory someone could construct
a normal function that starts with for_each_* and it would
not warn, but I think that would be uncommon. The alternative
of listing all macros was tried first, but turned out to 
be unwieldly.

I think I covered most of the common ones available, the
only exceptions are a few oddballs with leading prefix 
like pnp_for_each* or zorro_for_each.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

Index: linux-2.6.27-misc/scripts/checkpatch.pl
===================================================================
--- linux-2.6.27-misc.orig/scripts/checkpatch.pl
+++ linux-2.6.27-misc/scripts/checkpatch.pl
@@ -1513,6 +1513,7 @@ sub process {
 				if|for|while|switch|return|case|
 				volatile|__volatile__|
 				__attribute__|format|__extension__|
+				([ph]?list_)?for_each_[a-z_]+|
 				asm|__asm__)$/x)
 			{
 

             reply	other threads:[~2008-10-24 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24 11:50 Andi Kleen [this message]
2008-10-24 14:23 ` [PATCH] Handle space after for_each_* macros gracefully in checkpatch Andy Whitcroft

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=20081024115010.GA31761@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=apw@shadowen.org \
    --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