Skip to content

Commit 1b36b20

Browse files
JoePerchestorvalds
authored andcommitted
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@vt.edu> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 327953e commit 1b36b20

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4260,6 +4260,7 @@ sub process {
42604260
$ctx = $dstat;
42614261

42624262
$dstat =~ s/\\\n.//g;
4263+
$dstat =~ s/$;/ /g;
42634264

42644265
if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*\)\s*([;\s]*)\s*$/) {
42654266
my $stmts = $2;

0 commit comments

Comments
 (0)