From 95babbe5733f1851514ab8145dbb243d056f5366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 4 Apr 2022 16:12:34 +0200 Subject: [PATCH] scripts: cstyle: remove unused -h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13285 --- man/man1/cstyle.1 | 3 --- scripts/cstyle.pl | 17 +---------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/man/man1/cstyle.1 b/man/man1/cstyle.1 index b7c8b5719..e8f30f1f5 100644 --- a/man/man1/cstyle.1 +++ b/man/man1/cstyle.1 @@ -57,9 +57,6 @@ continuation line problems within functions only. The checks have some limitations; see .Sy CONTINUATION CHECKING , below. -.It Fl h -Performs heuristic checks that are sometimes wrong. -Not generally used. .It Fl p Performs some of the more picky checks. Includes ANSI diff --git a/scripts/cstyle.pl b/scripts/cstyle.pl index 0e1bc5e75..4846ea570 100755 --- a/scripts/cstyle.pl +++ b/scripts/cstyle.pl @@ -58,10 +58,9 @@ use Getopt::Std; use strict; my $usage = -"usage: cstyle [-cghpvP] file... +"usage: cstyle [-cgpvP] file... -c check continuation indentation inside functions -g print github actions' workflow commands - -h perform heuristic checks that are sometimes wrong -p perform some of the more picky checks -v verbose -P check for use of non-POSIX types @@ -76,7 +75,6 @@ if (!getopts("cghpvCP", \%opts)) { my $check_continuation = $opts{'c'}; my $github_workflow = $opts{'g'} || $ENV{'CI'}; -my $heuristic = $opts{'h'}; my $picky = $opts{'p'}; my $verbose = $opts{'v'}; my $check_posix_types = $opts{'P'}; @@ -691,19 +689,6 @@ line: while (<$filehandle>) { err("non-POSIX typedef $1 used: use $old2posix{$1} instead"); } } - if ($heuristic) { - # cannot check this everywhere due to "struct {\n...\n} foo;" - if ($in_function && !$in_declaration && - /\}./ && !/\}\s+=/ && !/\{.*\}[;,]$/ && !/\}(\s|)*$/ && - !/\} (else|while)/ && !/\}\}/) { - err("possible bad text following right brace"); - } - # cannot check this because sub-blocks in - # the middle of code are ok - if ($in_function && /^\s+\{/) { - err("possible left brace starting a line"); - } - } if (/^\s*else\W/) { if ($prev =~ /^\s*\}$/) { err_prefix($prev,