checkpatch: complex macros need to ignore comments
authorAndy Whitcroft <apw@shadowen.org>
Thu, 24 Jul 2008 04:29:11 +0000 (21:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:26 +0000 (10:47 -0700)
Ensure we ignore comments in complex macro detection else we incorrectly
report this:

#define PFM_GROUP_PERM_ANY     -1      /* any user/group */

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 8afa88aaed965d5e64394767a6e48eaa22dfdfdf..96a762be57484c71ea4d4f13ae76f1614bb313d5 100755 (executable)
@@ -1972,6 +1972,7 @@ sub process {
                        } else {
                                $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//;
                        }
+                       $dstat =~ s/$;//g;
                        $dstat =~ s/\\\n.//g;
                        $dstat =~ s/^\s*//s;
                        $dstat =~ s/\s*$//s;