From: Dan Williams <dan.j.williams@intel.com>
To: apw@shadowen.org, rdunlap@xenotime.net, jschopp@austin.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: add an exclusion for 'for_each' helper macros
Date: Fri, 08 Jun 2007 10:11:05 -0700 [thread overview]
Message-ID: <20070608171105.7391.40550.stgit@dwillia2-linux.ch.intel.com> (raw)
checkpatch currently complains about macros like the following:
#define for_each_dma_cap_mask(cap, mask) \
for ((cap) = first_dma_cap(mask); \
(cap) < DMA_TX_TYPE_END; \
(cap) = next_dma_cap((cap), (mask)))
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
scripts/checkpatch.pl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e216d49..ee6bac9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -548,10 +548,10 @@ sub process {
}
}
-#multiline macros should be enclosed in a do while loop
+#multiline macros should be enclosed in a do while loop, unless they are a for_each helper
if (($prevline=~/\#define.*\\/) and !($prevline=~/do\s+{/) and
!($prevline=~/\(\{/) and ($line=~/;\s*\\/) and
- !($line=~/do.*{/) and !($line=~/\(\{/)) {
+ !($line=~/do.*{/) and !($line=~/\(\{/) and !($prevline=~/.*for_each.*/)) {
print "Macros with multiple statements should be enclosed in a do - while loop\n";
print "$hereprev";
$clean = 0;
next reply other threads:[~2007-06-08 17:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 17:11 Dan Williams [this message]
2007-06-08 17:46 ` [PATCH] checkpatch: add an exclusion for 'for_each' helper macros Joel Schopp
2007-06-09 14:06 ` 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=20070608171105.7391.40550.stgit@dwillia2-linux.ch.intel.com \
--to=dan.j.williams@intel.com \
--cc=apw@shadowen.org \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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