summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-03-07 19:28:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-07 21:32:01 -0500
commit98005e8c743f9a5ef3a0e6c971d424da118bd07e (patch)
treeefd727b0d19877ac7f8c60be365539ad78a0c811 /scripts/checkpatch.pl
parente29a70f1537b1225daceae8d34bf5bfb80546138 (diff)
checkpatch: allow reporting C99 style comments
Presently C99 style comments are removed unconditionally before actual patch validity check happens. This is a problem for some third party projects which use checkpatch.pl but do not allow C99 style comments. This patch adds yet another variable, named C99_COMMENT_TOLERANCE. If it is included in the --ignore command line or config file options list, C99 comments in the patch are reported as errors. Tested by processing a patch with a C99 style comment, it passes the check just fine unless '--ignore C99_COMMENT_TOLERANCE' is present in .checkpatch.conf. Link: http://lkml.kernel.org/r/20190110224957.25008-1-vbendeb@chromium.org Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 76748ab23ce9..cbbeb3830a48 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -61,7 +61,7 @@ my $codespellfile = "/usr/share/codespell/dictionary.txt";
61my $conststructsfile = "$D/const_structs.checkpatch"; 61my $conststructsfile = "$D/const_structs.checkpatch";
62my $typedefsfile = ""; 62my $typedefsfile = "";
63my $color = "auto"; 63my $color = "auto";
64my $allow_c99_comments = 1; 64my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
65 65
66sub help { 66sub help {
67 my ($exitcode) = @_; 67 my ($exitcode) = @_;
@@ -1021,6 +1021,7 @@ if ($git) {
1021} 1021}
1022 1022
1023my $vname; 1023my $vname;
1024$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"};
1024for my $filename (@ARGV) { 1025for my $filename (@ARGV) {
1025 my $FILE; 1026 my $FILE;
1026 if ($git) { 1027 if ($git) {