Selaa lähdekoodia

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>
Joe Perches 10 vuotta sitten
vanhempi
commit
1b36b201c0
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      scripts/checkpatch.pl

+ 1 - 0
scripts/checkpatch.pl

@@ -4260,6 +4260,7 @@ sub process {
 			$ctx = $dstat;
 			$ctx = $dstat;
 
 
 			$dstat =~ s/\\\n.//g;
 			$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*$/) {
 			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;
 				my $stmts = $2;