[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1420752693.11784.13.camel@perches.com>
Date: Thu, 08 Jan 2015 13:31:33 -0800
From: Joe Perches <joe@...ches.com>
To: Valdis.Kletnieks@...edu, Andrew Morton <akpm@...ux-foundation.org>
Cc: shirish gajera <gajerashirish@...il.com>,
kernelnewbies@...nelnewbies.org,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: Allow comments in macros tested for single
statements
Convert all the comments to spaces before testing for
single statement macros.
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@...edu>
Signed-off-by: Joe Perches <joe@...ches.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists