scripts: cstyle: remove unused -C

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13285
This commit is contained in:
наб 2022-04-04 16:07:53 +02:00 committed by Brian Behlendorf
parent 9292cf761e
commit 93f3a3517c
2 changed files with 3 additions and 21 deletions

View File

@ -73,10 +73,6 @@ Used as part of the putback checks.
Verbose output; includes the text of the line of error, and, for Verbose output; includes the text of the line of error, and, for
.Fl c , .Fl c ,
the first statement in the current continuation block. the first statement in the current continuation block.
.It Fl C
Ignore errors in header comments (i.e. block comments starting in the
first column).
Not generally used.
.It Fl P .It Fl P
Check for use of non-POSIX types. Check for use of non-POSIX types.
Historically, types like Historically, types like

View File

@ -58,13 +58,12 @@ use Getopt::Std;
use strict; use strict;
my $usage = my $usage =
"usage: cstyle [-cghpvCP] file... "usage: cstyle [-cghpvP] file...
-c check continuation indentation inside functions -c check continuation indentation inside functions
-g print github actions' workflow commands -g print github actions' workflow commands
-h perform heuristic checks that are sometimes wrong -h perform heuristic checks that are sometimes wrong
-p perform some of the more picky checks -p perform some of the more picky checks
-v verbose -v verbose
-C don't check anything in header block comments
-P check for use of non-POSIX types -P check for use of non-POSIX types
"; ";
@ -80,7 +79,6 @@ my $github_workflow = $opts{'g'} || $ENV{'CI'};
my $heuristic = $opts{'h'}; my $heuristic = $opts{'h'};
my $picky = $opts{'p'}; my $picky = $opts{'p'};
my $verbose = $opts{'v'}; my $verbose = $opts{'v'};
my $ignore_hdr_comment = $opts{'C'};
my $check_posix_types = $opts{'P'}; my $check_posix_types = $opts{'P'};
my ($filename, $line, $prev); # shared globals my ($filename, $line, $prev); # shared globals
@ -213,7 +211,6 @@ my $in_cpp = 0;
my $next_in_cpp = 0; my $next_in_cpp = 0;
my $in_comment = 0; my $in_comment = 0;
my $in_header_comment = 0;
my $comment_done = 0; my $comment_done = 0;
my $in_warlock_comment = 0; my $in_warlock_comment = 0;
my $in_function = 0; my $in_function = 0;
@ -444,7 +441,6 @@ line: while (<$filehandle>) {
if ($comment_done) { if ($comment_done) {
$in_comment = 0; $in_comment = 0;
$in_header_comment = 0;
$comment_done = 0; $comment_done = 0;
} }
# does this looks like the start of a block comment? # does this looks like the start of a block comment?
@ -455,9 +451,6 @@ line: while (<$filehandle>) {
$in_comment = 1; $in_comment = 1;
/^(\s*)\//; /^(\s*)\//;
$comment_prefix = $1; $comment_prefix = $1;
if ($comment_prefix eq "") {
$in_header_comment = 1;
}
$prev = $line; $prev = $line;
next line; next line;
} }
@ -467,20 +460,13 @@ line: while (<$filehandle>) {
$comment_done = 1; $comment_done = 1;
} elsif (/\*\//) { } elsif (/\*\//) {
$comment_done = 1; $comment_done = 1;
err("improper block comment close") err("improper block comment close");
unless ($ignore_hdr_comment && $in_header_comment);
} elsif (!/^$comment_prefix \*[ \t]/ && } elsif (!/^$comment_prefix \*[ \t]/ &&
!/^$comment_prefix \*$/) { !/^$comment_prefix \*$/) {
err("improper block comment") err("improper block comment");
unless ($ignore_hdr_comment && $in_header_comment);
} }
} }
if ($in_header_comment && $ignore_hdr_comment) {
$prev = $line;
next line;
}
# check for errors that might occur in comments and in code. # check for errors that might occur in comments and in code.
# allow spaces to be used to draw pictures in all comments. # allow spaces to be used to draw pictures in all comments.