mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Allow comments in macros tested for single statements
       [not found]     ` <79493.1420750167@turing-police.cc.vt.edu>
@ 2015-01-08 21:31       ` Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2015-01-08 21:31 UTC (permalink / raw)
  To: Valdis.Kletnieks, Andrew Morton; +Cc: shirish gajera, kernelnewbies, LKML

Convert all the comments to spaces before testing for
single statement macros.

Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Joe Perches <joe@perches.com>
---
> It's interesting that the warning only popped on the one case where the
> "/* looping version */" is on a separate line, not on the #else line.
> 
> Am cc'ing Joe Perches for that question. Joe - to get you up to speed,
> checkpatch was run against drivers/staging/skein/skein_block.c, and it
> flagged one definition of the macro R256, but not the other one, or the
> two definitions each for R512 and R1024.  Any idea why?

Yup, that was it...

 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6afc24b..6ac355e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4260,6 +4260,7 @@ sub process {
 			$ctx = $dstat;
 
 			$dstat =~ s/\\\n.//g;
+			$dstat =~ s/$;/ /g;
 
 			if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*\)\s*([;\s]*)\s*$/) {
 				my $stmts = $2;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-08 21:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAG77vrowzc04Z4_zZfCEwhF-kx=RnAnyXa0afsYL5dGsr2=Tng@mail.gmail.com>
     [not found] ` <78761.1420749142@turing-police.cc.vt.edu>
     [not found]   ` <CAG77vrrp-N9-C4cCmLr6p_fVM_bRwYni5-ixuOry+qE7opeU3A@mail.gmail.com>
     [not found]     ` <79493.1420750167@turing-police.cc.vt.edu>
2015-01-08 21:31       ` [PATCH] checkpatch: Allow comments in macros tested for single statements Joe Perches

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