Skip to content

Commit

Permalink
checkpatch: allow reporting C99 style comments
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Vadim Bendebury <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Vadim Bendebury authored and torvalds committed Mar 8, 2019
1 parent e29a70f commit 98005e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
my $conststructsfile = "$D/const_structs.checkpatch";
my $typedefsfile = "";
my $color = "auto";
my $allow_c99_comments = 1;
my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE

sub help {
my ($exitcode) = @_;
Expand Down Expand Up @@ -1021,6 +1021,7 @@ sub git_commit_info {
}

my $vname;
$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"};
for my $filename (@ARGV) {
my $FILE;
if ($git) {
Expand Down

0 comments on commit 98005e8

Please sign in to comment.