Lines Matching full:if

55 $gitroot = ".git" if !defined($gitroot);
118 if exceeded, warn on patches
120 --min-conf-desc-length=n set the min description length, if shorter, warn
132 If correctable single-line errors exist, create
138 file. It's your fault if there's no backup or git
178 if (defined($1)) {
179 if (exists($types{$2})) {
180 $types{$2} .= ",$1" if ($types{$2} ne $1);
190 if ($color) {
204 if ($color) {
206 if ($level eq "ERROR") {
215 if ($verbose && exists($verbose_messages{$orig_type})) {
226 if (-f $conf) {
238 next if ($line =~ m/^\s*#/);
239 next if ($line =~ m/^\s*$/);
243 last if ($word =~ m/^#/);
248 unshift(@ARGV, @conf_args) if @conf_args;
264 if ($line =~ /^\s*\*\*(.+)\*\*$/) {
265 if ($desc ne '') {
272 if ($line =~ /^(?:\s{4,}|$)/) {
285 if ($desc ne '') {
294 if ($_ eq "--color" || $_ eq "-color") {
340 if ($user_codespellfile) {
344 # If /usr/share/codespell/dictionary.txt is not present, try to find it
346 if (($codespell || $help) && which("python3") ne "") {
357 $codespellfile = $codespell_dict if (-f $codespell_dict);
361 # $help is 1 if either -h, --help or --version is passed as option - exitcode: 0
362 # $help is 2 if invalid option is passed - exitcode: 1
363 help($help - 1) if ($help);
365 die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix));
366 die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse);
368 if ($color =~ /^[01]$/) {
380 load_docs() if ($verbose);
381 list_types(0) if ($list_types);
383 $fix = 1 if ($fix_inplace);
389 if ($^V && $^V lt $minimum_perl_version) {
392 exit(1) if (!$ignore_perl_version);
395 #if no filenames are given, push '-' to read patch from stdin
396 if ($#ARGV < 0) {
401 die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2);
413 next if ($word =~ m/^\s*#/);
414 next if ($word =~ m/^\s*$/);
423 if (keys %$hashRef) {
442 die "$@" if ($@);
447 if ($terse) {
452 if ($tree) {
453 if (defined $root) {
454 if (!top_of_kernel_tree($root)) {
458 if (top_of_kernel_tree('.')) {
466 if (!defined $root) {
554 our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x;
639 if ($link_tags_search ne "") {
676 if ((scalar @arr) < 1) {
677 # if underflow, return
682 if ($arr[$i] < $min) {
701 if ($i == 0) {
725 return $signature if (get_edit_distance($sign_off, $signature) <= 2);
835 $mode_perms_search .= '|' if ($mode_perms_search ne "");
860 $deprecated_apis_search .= '|' if ($deprecated_apis_search ne "");
895 $mode_perms_string_search .= '|' if ($mode_perms_string_search ne "");
907 return trim($string) if ($string =~ /^\s*0[0-7]{3,3}\s*$/);
918 last if ($lastpos > 0 && ($curpos - length($omatch) != $lastpos));
921 $val .= '\s*\|\s*' if ($val ne "");
942 if (open(my $spelling, '<', $spelling_file)) {
949 next if ($line =~ m/^\s*#/);
950 next if ($line =~ m/^\s*$/);
961 if ($codespell) {
962 if (open(my $spelling, '<', $codespellfile)) {
969 next if ($line =~ m/^\s*#/);
970 next if ($line =~ m/^\s*$/);
971 next if ($line =~ m/, disabled/i);
985 $misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix;
990 if (open(my $words, '<', $file)) {
997 next if ($line =~ m/^\s*#/);
998 next if ($line =~ m/^\s*$/);
999 if ($line =~ /\s/) {
1004 $$wordsRef .= '|' if (defined $$wordsRef);
1015 if (show_type("CONST_STRUCT")) {
1020 if (defined($typedefsfile)) {
1024 $typeTypedefs .= '|' . $typeOtherTypedefs if (defined $typeOtherTypedefs);
1103 return "" if (!defined($string));
1118 return if (!(-f $file));
1130 next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/);
1131 if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) {
1146 return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl"));
1148 if (!exists($maintained_status{$filename})) {
1158 …return 1 if (!$tree || which("python3") eq "" || !(-x "$root/scripts/spdxcheck.py") || !(-e "$gitr…
1162 return 0 if ($status ne "");
1168 return if ($camelcase_seeded);
1176 if (-e "$gitroot") {
1187 $last_mod_date = $date if ($last_mod_date < $date);
1192 if ($camelcase_cache ne "" && -f $camelcase_cache) {
1204 if (-e "$gitroot") {
1213 if ($camelcase_cache ne "") {
1227 return 0 if ((which("git") eq "") || !(-e "$gitroot"));
1237 return ($id, $desc) if ((which("git") eq "") || !(-e "$gitroot"));
1243 return ($id, $desc) if ($#lines < 0);
1245 if ($lines[0] =~ /^error: short SHA1 $commit is ambiguous/) {
1266 $chk_signoff = 0 if ($file);
1267 $chk_fixes_tag = 0 if ($file);
1276 # If input is git commits, extract all commits from the commit expressions.
1278 die "$P: No git repository found\n" if ($git && !-e "$gitroot");
1280 if ($git) {
1284 if ($commit_expr =~ m/^(.*)-(\d+)$/) {
1294 next if (!defined($1) || !defined($2));
1301 die "$P: no git commits after extraction!\n" if (@commits == 0);
1311 $file = 1 if ($is_git_file);
1312 if ($git) {
1324 if ($filename eq '-') {
1334 $vname = qq("$1") if ($filename eq '-' && $_ =~ m/^Subject:\s+(.+)/i);
1338 if ($#ARGV > 0 && $quiet == 0) {
1344 if (!process($filename)) {
1356 $file = $oldfile if ($is_git_file);
1359 if (!$quiet) {
1363 if (!$perl_version_ok) {
1370 if ($exit) {
1373 NOTE: If any of the errors are false positives, please report
1391 if (! -e $root . '/' . $check) {
1407 if ($formatted_email =~ /^(.*)<(\S+\@\S+)>(.*)$/) {
1410 $comment = $3 if defined $3;
1413 $comment = $2 if defined $2;
1416 $comment = $2 if defined $2;
1421 # If there's a name left after stripping spaces and
1427 if ($name ne "" && $address !~ /^<[^>]+>$/) {
1436 if ($name =~ s/\"(.+)\"//) {
1449 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
1466 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
1472 $name_comment = " $name_comment" if ($name_comment ne "");
1474 $comment = " $comment" if ($comment ne "");
1476 if ("$name" eq "") {
1508 if (-e "$path/$bin") {
1520 if (-e "$path/$conf") {
1534 if ($c eq "\t") {
1571 if ($in_comment) {
1595 if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') {
1602 if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') {
1608 if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') {
1617 if (($sanitise_quote eq "'" || $sanitise_quote eq '"') &&
1624 if ($c eq "'" || $c eq '"') {
1625 if ($sanitise_quote eq '') {
1636 if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") {
1647 if ($sanitise_quote eq '//') {
1652 if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) {
1662 if ($allow_c99_comments && $res =~ m@(//.*$)@) {
1673 return "" if (!defined($line) || !defined($rawline));
1674 return "" if ($line !~ m/($String)/g);
1697 @stack = (['', 0]) if ($#stack == -1);
1700 # If we are about to drop off the end, pull in more
1702 if ($off >= $len) {
1704 last if (!defined $lines[$line]);
1705 next if ($lines[$line] =~ /^-/);
1713 # Bail if there is no further context.
1715 if ($off >= $len) {
1718 if ($level == 0 && substr($blk, $off) =~ /^.\s*#\s*define/) {
1729 # Handle nested #if/#else.
1730 if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) {
1740 if ($level == 0 && $c eq ';') {
1744 # An else is really a conditional as long as its not else if
1745 if ($level == 0 && $coff_set == 0 &&
1748 $remainder !~ /^else\s+if\b/) {
1755 if (($type eq '' || $type eq '(') && $c eq '(') {
1759 if ($type eq '(' && $c eq ')') {
1763 if ($level == 0 && $coff < $soff) {
1769 if (($type eq '' || $type eq '{') && $c eq '{') {
1773 if ($type eq '{' && $c eq '}') {
1777 if ($level == 0) {
1778 if (substr($blk, $off + 1, 1) eq ';') {
1785 if ($type eq '#' && $c eq "\n" && $p ne "\\") {
1794 if ($off == $len) {
1848 if ($stmt_lines > $stmt_statements) {
1866 if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) {
1870 # Pull in the following conditional/block pairs and see if they
1876 last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s));
1896 next if ($rawlines[$line] =~ /^-/);
1901 # Handle nested #if/#else.
1902 if ($lines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) {
1912 if ($off > 0) {
1917 if ($c eq $close && $level > 0) {
1919 last if ($level == 0);
1925 if (!$outer || $level <= 1) {
1929 last if ($level == 0);
1966 # If c99 comment on the current line, or the line before or after
1968 return $current_comment if (defined $current_comment);
1970 return $current_comment if (defined $current_comment);
1972 return $current_comment if (defined $current_comment);
1976 return $current_comment if (defined $current_comment);
1978 # Look through the context and try and figure out if there is a
1985 if ($linenr == $first_line and $line =~ m@^.\s*\*@) {
1988 if ($line =~ m@/\*@) {
1991 if (!$in_comment && $current_comment ne '') {
1994 $current_comment .= $line . "\n" if ($in_comment);
1995 if ($line =~ m@\*/@) {
2022 next if (defined($line) && $line =~ /^-/);
2058 if ($2 ne '') {
2087 print "$stream\n" if ($dbg_values > 1);
2090 @av_paren_type = ('E') if ($#av_paren_type < 0);
2092 "> <$type> <$av_pending>" if ($dbg_values > 1);
2093 if ($cur =~ /^(\s+)/o) {
2094 print "WS($1)\n" if ($dbg_values > 1);
2095 if ($1 =~ /\n/ && $av_preprocessor) {
2101 print "CAST($1)\n" if ($dbg_values > 1);
2106 print "DECLARE($1)\n" if ($dbg_values > 1);
2110 print "MODIFIER($1)\n" if ($dbg_values > 1);
2114 print "DEFINE($1,$2)\n" if ($dbg_values > 1);
2117 if ($2 ne '') {
2123 print "UNDEF($1)\n" if ($dbg_values > 1);
2127 } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
2128 print "PRE_START($1)\n" if ($dbg_values > 1);
2136 print "PRE_RESTART($1)\n" if ($dbg_values > 1);
2144 print "PRE_END($1)\n" if ($dbg_values > 1);
2149 # one does, and continue as if the #endif was not here.
2155 print "PRECONT($1)\n" if ($dbg_values > 1);
2158 print "ATTR($1)\n" if ($dbg_values > 1);
2163 print "SIZEOF($1)\n" if ($dbg_values > 1);
2164 if (defined $2) {
2169 } elsif ($cur =~ /^(if|while|for)\b/o) {
2170 print "COND($1)\n" if ($dbg_values > 1);
2175 print "CASE($1)\n" if ($dbg_values > 1);
2180 print "KEYWORD($1)\n" if ($dbg_values > 1);
2184 print "PAREN('$1')\n" if ($dbg_values > 1);
2191 if ($new_type ne '_') {
2194 if ($dbg_values > 1);
2196 print "PAREN('$1')\n" if ($dbg_values > 1);
2200 print "FUNC($1)\n" if ($dbg_values > 1);
2205 if (defined $2 && $type eq 'C' || $type eq 'T') {
2210 print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1);
2214 print "IDENT($1)\n" if ($dbg_values > 1);
2218 print "ASSIGN($1)\n" if ($dbg_values > 1);
2222 print "END($1)\n" if ($dbg_values > 1);
2227 print "COMMA($1)\n" if ($dbg_values > 1);
2231 print "QUESTION($1)\n" if ($dbg_values > 1);
2235 print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1);
2238 if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') {
2246 print "CLOSE($1)\n" if ($dbg_values > 1);
2252 print "OPV($1)\n" if ($dbg_values > 1);
2253 if ($type eq 'V') {
2263 print "OP($1)\n" if ($dbg_values > 1);
2264 if ($1 ne '++' && $1 ne '--') {
2269 print "C($1)\n" if ($dbg_values > 1);
2271 if (defined $1) {
2301 warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
2302 if ($possible !~ $notPermitted) {
2306 if ($possible =~ /^\s*$/) {
2311 if ($modifier !~ $notPermitted) {
2312 warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible);
2318 warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
2323 warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1);
2334 return defined $use_type{$type} if (scalar keys %use_type > 0);
2342 if (!show_type($type) ||
2347 if ($color) {
2348 if ($level eq 'ERROR') {
2357 if ($show_types) {
2358 $output .= BLUE if ($color);
2361 $output .= RESET if ($color);
2364 if ($showfile) {
2370 if ($terse) {
2374 if ($verbose && exists($verbose_messages{$type}) &&
2392 if ($$lineRef =~ /^\@\@ -\d+,\d+ \+(\d+),(\d+) \@\@/) {
2421 if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\S+/) { #new filename
2441 if ($save_line) {
2476 if (report("ERROR", $type, $msg)) {
2486 if (report("WARNING", $type, $msg)) {
2496 if ($check && report("CHECK", $type, $msg)) {
2510 # See if any suffix of this path is a path within the tree.
2512 if (-f "$root/$file") {
2517 if (! -f _) {
2521 # It is, so see if the prefix is acceptable.
2526 if ($prefix ne ".../") {
2589 if (($opens == 0) || ($closes >= $opens)) {
2597 if ($string =~ /^($FuncArg|$balanced_parens)/) {
2614 if (substr($line, $i, 1) eq "$;") {
2714 push(@fixed, $rawline) if ($fix);
2716 if ($rawline=~/^\+\+\+\s+(\S+)/) {
2718 if ($1 =~ m@Documentation/admin-guide/kernel-parameters.txt$@) {
2723 if ($rawline =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
2725 if (defined $2) {
2732 # Guestimate if this is a continuing comment. Run
2733 # the context looking for a comment "edge". If this
2739 next if (defined $rawlines[$ln - 1] &&
2743 last if (!defined $rawlines[$ln - 1]);
2744 if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ &&
2750 if (defined $edge && $edge eq '*/') {
2754 # Guestimate if this is a continuing comment. If this
2757 if (!defined $edge &&
2773 if ($realcnt > 1) {
2774 $realcnt-- if ($line =~ /^(?:\+| |$)/);
2782 if ($setup_docs && $line =~ /^\+/) {
2801 # check if it's a mode change, rename or start of a patch
2802 if (!$in_commit_log &&
2810 if (!$in_commit_log &&
2816 if (defined $2) {
2828 if ($context =~ /\b(\w+)\s*\(/) {
2840 $realcnt-- if ($realcnt != 0);
2858 $here = "#$linenr: " if (!$file);
2859 $here = "#$realline: " if ($file);
2863 if ($line =~ /^diff --git.*?(\S+)$/) {
2865 $realfile =~ s@^([^/]*)/@@ if (!$file);
2870 $realfile =~ s@^([^/]*)/@@ if (!$file);
2874 if (!$file && $tree && $p1_prefix ne '' &&
2880 if ($realfile =~ m@^include/asm/@) {
2888 if ($showfile) {
2891 if ($file) {
2898 if ($found_file) {
2899 if (is_maintained_obsolete($realfile)) {
2903 if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
2910 if ($realfile !~ /^MAINTAINERS/) {
2915 if (($last_binding_patch != -1) &&
2925 $here .= "FILE: $realfile:$realline:" if ($realcnt != 0);
2931 $cnt_lines++ if ($realcnt != 0);
2933 # Verify the existence of a commit log if appropriate
2935 if ($in_commit_log) {
2936 if ($line !~ /^\s*$/) {
2945 # Check if the commit log has what seems like a diff which can confuse patch
2946 if ($in_commit_log && !$commit_log_has_diff &&
2957 if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) {
2959 if ($realfile !~ m@scripts/@ &&
2967 if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
2973 $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
2979 if ($line =~ /^\s*signed-off-by:\s*(.*)/i) {
2982 if ($author ne '' && $authorsignoff != 1) {
2983 if (same_email_addresses($1, $author)) {
2990 if (lc $email_address eq lc $author_address && $email_name eq $author_name) {
3003 if ($address1 =~ /(\S+)\+\S+(\@.*)/) {
3006 if ($address2 =~ /(\S+)\+\S+(\@.*)/) {
3009 if ($address1 eq $address2) {
3018 if ($line =~ /^---$/) {
3023 # Check if MAINTAINERS is being updated. If so, there's probably no need to
3025 if ($line =~ /^\s*MAINTAINERS\s*\|/) {
3030 if (!$in_header_lines &&
3038 if ($sign_off !~ /$signature_tags/) {
3040 if ($suggested_signature eq "") {
3044 if (WARN("BAD_SIGN_OFF",
3051 if (defined $space_before && $space_before ne "") {
3052 if (WARN("BAD_SIGN_OFF",
3059 if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) {
3060 if (WARN("BAD_SIGN_OFF",
3068 if (!defined $space_after || $space_after ne " ") {
3069 if (WARN("BAD_SIGN_OFF",
3079 if ($suggested_email eq "") {
3088 if (!same_email_addresses($email, $suggested_email)) {
3089 if (WARN("BAD_SIGN_OFF",
3099 if ($email_address ne $stripped_address) {
3100 if (WARN("BAD_SIGN_OFF",
3109 if ($comment_count > 1) {
3118 if ($email =~ /^.*stable\@(?:vger\.)?kernel\.org/i) {
3119 if (($comment ne "" && $comment !~ /^#.+/) ||
3131 $new_comment = trim("$new_comment $cur_name") if ($cur_name ne $new_comment);
3132 $new_comment = " # $new_comment" if ($new_comment ne "");
3135 if (WARN("BAD_STABLE_ADDRESS_STYLE",
3151 $new_comment = "($new_comment)" if ($new_comment ne "");
3154 if (WARN("BAD_SIGN_OFF",
3166 if (defined $signatures{$sig_nospace}) {
3174 if ($sign_off =~ /^co-developed-by:$/i) {
3175 if ($email eq $author) {
3179 if (!defined $lines[$linenr]) {
3191 # check if Reported-by: is followed by a Closes: tag
3192 if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) {
3193 if (!defined $lines[$linenr]) {
3204 if (!$in_header_lines && !$is_patch &&
3209 if (!$in_header_lines && !$is_patch &&
3215 if (!$in_header_lines &&
3227 if ($line =~ /(\s*fixes:?)\s+([0-9a-f]{5,})\s+($balanced_parens)/i) {
3232 $tag_case = 0 if $tag eq "Fixes:";
3233 $tag_space = 0 if ($line =~ /^fixes:? [0-9a-f]{5,} ($balanced_parens)/i);
3235 $id_length = 0 if ($orig_commit =~ /^[0-9a-f]{12}$/i);
3236 $id_case = 0 if ($orig_commit !~ /[A-F]/);
3238 # Always strip leading/trailing parens then double quotes if existing
3240 if ($title =~ /^".*"$/) {
3249 if ($ctitle ne $title || $tag_case || $tag_space ||
3251 if (WARN("BAD_FIXES_TAG",
3260 if ($in_header_lines &&
3267 if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
3268 if (ERROR("GERRIT_CHANGE_ID",
3275 # Check if the commit log is in a possible stack dump
3276 if ($in_commit_log && !$commit_log_possible_stack_dump &&
3288 if ($in_commit_log && !$commit_log_long_line &&
3302 # Reset possible stack dump if a blank line is found
3303 if ($in_commit_log && $commit_log_possible_stack_dump &&
3309 if ($in_commit_log &&
3311 if ($1 =~ /^v(?:ersion)?\d+/i) {
3321 if ($in_commit_log &&
3325 if ($tag =~ /^$link_tags_search$/ && $value !~ m{^https?://}) {
3332 if ($in_commit_log && $line =~ /^#/) {
3333 if (WARN("COMMIT_COMMENT_SYMBOL",
3349 if ($perl_version_ok &&
3372 if ($line =~ /(?:\bcommit\s+[0-9a-f]{5,}|\bcommit\s*$)/i) {
3374 if ($input =~ /\bcommit\s+[0-9a-f]{5,}\s*($balanced_parens)/i) {
3377 # Always strip leading/trailing parens then double quotes if existing
3379 if ($orig_desc =~ /^".*"$/) {
3385 last if ($#lines < $linenr + $n);
3389 $herectx = $herecurr if (!$has_parens);
3392 if ($input =~ /\b(c)ommit\s+([0-9a-f]{5,})\b/i) {
3395 $short = 0 if ($input =~ /\bcommit\s+[0-9a-f]{12,40}/i);
3396 $long = 1 if ($input =~ /\bcommit\s+[0-9a-f]{41,}/i);
3397 $space = 0 if ($input =~ /\bcommit [0-9a-f]/i);
3398 $case = 0 if ($input =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/);
3406 if (defined($id) &&
3412 #don't report the next line if this line ends in commit and the sha1 hash is the next line
3413 $last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
3417 if ($rawline =~ m{http.*\b$obsolete_archives}) {
3423 if (!$reported_maintainer_file && !$in_commit_log &&
3435 if (!$in_commit_log &&
3443 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
3446 $herecurr) if (!$emitted_corrupt++);
3450 if (($realfile =~ /^$/ || $line =~ /^\+/) &&
3462 # Check if it's the start of a commit log
3464 if ($in_header_lines && $realfile =~ /^$/ &&
3472 # Check if there is UTF-8 in a commit log when a mail header has explicitly
3474 if ($in_header_lines &&
3480 if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ &&
3487 if ($tree && $in_commit_log) {
3491 if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
3501 if (defined($misspellings) &&
3509 $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/);
3510 $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/);
3512 $msg_level = \&CHK if ($file);
3513 if (&{$msg_level}("TYPO_SPELLING",
3522 if ($in_commit_log && $line =~ /(^fixes:|\bcommit)\s+([0-9a-f]{6,40})\b/i) {
3526 if (!defined($id)) {
3534 if (($rawline =~ /^\+/ || $in_commit_log) &&
3536 pos($rawline) = 1 if (!$in_commit_log);
3543 if ($first =~ /(?:struct|union|enum)/) {
3548 next if (lc($first) ne lc($second));
3549 next if ($first eq 'long');
3554 $start_char = substr($rawline, $start_pos - 1, 1) if ($start_pos > ($in_commit_log ? 0 : 1));
3555 $end_char = substr($rawline, $end_pos, 1) if ($end_pos < length($rawline));
3557 next if ($start_char =~ /^\S$/);
3558 next if (index(" \t.,;?!", $end_char) == -1);
3561 if ($first =~ /\b[0-9a-f]{2,}\b/i) {
3562 next if (!exists($allow_repeated_words{lc($first)}));
3565 if (WARN("REPEATED_WORD",
3572 # if it's a repeated word on consecutive lines in a comment block
3573 if ($prevline =~ /$;+\s*$/ &&
3576 if ($rawline =~ /^\+\s*\*\s*$last_word /) {
3577 if (WARN("REPEATED_WORD",
3587 next if (!$hunk_line || $line =~ /^-/);
3590 if ($line =~ /^\+.*\015/) {
3592 if (ERROR("DOS_LINE_ENDINGS",
3599 if (ERROR("TRAILING_WHITESPACE",
3609 if ($rawline =~ /\bwrite to the Free/i ||
3615 $msg_level = \&CHK if ($file);
3623 if ($realfile =~ /Kconfig/ &&
3635 next if ($f =~ /^-/);
3636 last if ($f !~ /^[\+ ]/); # !patch context
3638 if ($f =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
3642 if ($f =~ /^\+\s*help\s*$/) {
3650 next if ($f =~ /^$/); # skip blank lines
3657 if ($f =~ /^(?:config|menuconfig|choice|endchoice|
3658 if|endif|menu|endmenu|source)\b/x) {
3661 $help_length++ if ($has_help);
3663 if ($needs_help &&
3672 if ($realfile =~ /^MAINTAINERS$/) {
3674 if ($rawline =~ /^\+[A-Z]:/ &&
3676 if (WARN("MAINTAINERS_STYLE",
3684 if ($rawline =~ /^\+[A-Z]:/ &&
3694 if ($curindex < 0) {
3698 if ($previndex >= 0 && $curindex < $previndex) {
3711 if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
3722 …"Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($repl…
3726 if (defined $root &&
3741 if ( $? >> 8 ) {
3746 next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
3749 if ( $? >> 8 ) {
3757 if ($realline == $checklicenseline) {
3758 if ($rawline =~ /^[ \+]\s*\#\!\s*\//) {
3762 if ($realfile =~ /\.(h|s|S)$/) {
3773 if ($realfile =~ /\.[chsS]$/ &&
3780 if ($comment !~ /^$/ &&
3786 if (!is_SPDX_License_valid($spdx_license)) {
3790 if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
3793 $msg_level = \&CHK if ($file);
3794 if (&{$msg_level}("SPDX_LICENSE_TAG",
3801 if ($realfile =~ m@^include/dt-bindings/@ &&
3811 if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) {
3816 # check we are in a valid source file if not then ignore this hunk
3817 next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/);
3820 if ($realline != $checklicenseline &&
3840 # if LONG_LINE is ignored, the other 2 types are also ignored
3843 if ($line =~ /^\+/ && $length > $max_line_length) {
3850if ($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(?:KERN_\S+\s*|[^"]*))?($String\s*(?:|,|\)\s*;)\s*)$/ …
3882 if ($msg_type ne "" &&
3885 $msg_level = \&CHK if ($file);
3892if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file…
3893 if (WARN("MISSING_EOF_NEWLINE",
3901 if ($realfile =~ /\.S$/ &&
3907 # check we are in a valid source file C or perl if not then ignore this hunk
3908 next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
3912 if ($rawline =~ /^\+\s* \t\s*\S/ ||
3916 if (ERROR("CODE_INDENT",
3924 if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
3926 if (WARN("SPACE_BEFORE_TAB",
3937 if ($sline =~ /^\+\s+($Assignment)[^=]/) {
3939 if (CHK("ASSIGNMENT_CONTINUATIONS",
3949 if ($rawline =~ /^\+\s*(&&|\|\|)/) {
3951 if (CHK("LOGICAL_CONTINUATIONS",
3963 if ($perl_version_ok &&
3966 if ($indent % $tabsize) {
3967 if (WARN("TABSTOP",
3976 if ($perl_version_ok &&
3977 …$prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident…
3983 if ($pos >= 0) {
3992 if ($newindent ne $goodtabindent &&
3995 if (CHK("PARENTHESIS_ALIGNMENT",
4012 if ($line =~ /^\+(.*)\(\s*$Type\s*\)([ \t]++)((?![={]|\\$|$Attribute|__attribute__))/ &&
4014 if (CHK("SPACING",
4024 if ($realfile =~ m@^(drivers/net/|net/)@ &&
4033 if ($prevline =~ /$;[ \t]*$/ && #ends in comment
4043 if ($rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */
4052 if ($prevline =~ /$;[ \t]*$/ && #ends in comment
4060 if (defined($1)) {
4069 if (length($oldindent) ne length($newindent)) {
4077 if ($prevline =~ /^[\+ ]};?\s*$/ &&
4088 if (CHK("LINE_SPACING",
4096 if ($prevline =~ /^[\+ ]\s*$/ &&
4099 if (CHK("LINE_SPACING",
4110 if (($prevline =~ /\+(\s+)\S/) && $sline =~ /^\+$1\S/) {
4117 if (($pl =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
4124 # for "else if" which can look like "$Ident $Ident"
4146 if (WARN("LINE_SPACING",
4159 if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/) {
4161 if (WARN("LEADING_SPACE",
4168 # check we are in a valid C source file if not then ignore this hunk
4169 next if ($realfile !~ /\.(h|c)$/);
4172 if ($line =~ /^\+.*([\[\(])\s*$/) {
4177 # check if this appears to be the start function declaration, save the name
4178 if ($sline =~ /^\+\{\s*$/ &&
4183 # check if this appears to be the end of function declaration
4184 if ($sline =~ /^\+\}\s*$/) {
4189 # (but not if it is a multiple line "if (foo) return bar; else return baz;")
4190 # if the previous line is a break or return and is indented 1 tab more...
4191 if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) {
4193 if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ ||
4203 # if the previous line is a goto, return or break
4205 if ($sline =~ /^\+([\t]+)break\s*;\s*$/) {
4207 if ($prevline =~ /^\+$tabs(goto|return|break)\b/) {
4208 if (WARN("UNNECESSARY_BREAK",
4217 if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
4223 if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) {
4232 if ($linenr > $suppress_statement &&
4240 # If this statement has no statement boundaries within
4244 if ($frag !~ /(?:{|;)/) {
4251 if (defined $realline_next &&
4261 if ($s =~ /$Ident:\*$/s) {
4287if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$I…
4295if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$…
4310 if ($line=~/\bswitch\s*\(.*\)/) {
4317 if ($ctx =~ /^\+\s*(case\s+|default:)/ &&
4325 if ($err ne '') {
4331 # if/while/etc brace do not go on next line, unless defining a do while loop,
4332 # or if that brace on the next line is for something else
4333if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $li…
4338 if ($line =~ /^\+\t{6,}/) {
4353 $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/);
4360 if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln - 1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
4365 if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
4370 if ($nindent > $indent) {
4379if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ && $line !~ /…
4382 if (!defined $stat);
4412 if ($s =~ s/^\s*\\//) {
4415 if ($s =~ s/^\s*?\n//) {
4422 if (($prevline =~ /^.\s*#\s*define\s/ ||
4432 # If we see an #else/#elif then the code
4434 if ($s =~ /^\s*\#\s*(?:else|elif)/) {
4442 if ($continuation ||
4447 if ($s =~ s/^.*?\n//) {
4456 # Check if either of these lines are modified, else
4458 if (!defined($stat_real) ||
4462 if (defined($stat_real) && $cond_lines > 1) {
4468 if ($check && $s ne '' &&
4484 if ($dbg_values) {
4493 next if ($line =~ /^[^\+]/);
4498 if ($line =~ /^\+\s*(?:$Declare)?([A-Za-z_][A-Za-z\d_]*)\s*=/) {
4500if ($line =~ /^\+\s*(?:$Declare)?$var\s*=\s*(?:$var|\*\s*\(?\s*&\s*\(?\s*$var\s*\)?\s*\)?)\s*[;,]/…
4507 if ($prevline =~ /^\+.*$Lval\s*(?:\.|->)\s*$/ &&
4508 $line =~ /^\+\s*(?!\#\s*(?!define\s+|if))\s*$Lval/) {
4522 $var = "" if (!defined $var);
4523 if ($type =~ /^(?:(?:$Storage|$Inline|$Attribute)\s+)*((?:un)?signed)((?:\s*\*)*)\s*$/) {
4527 $pointer = "" if (!defined $pointer);
4529 if (WARN("UNSPECIFIED_INT",
4536 $decl = rtrim($decl) if ($var eq "");
4543 if ($dbg_type) {
4544 if ($line =~ /^.\s*$Declare\s*$/) {
4554 if ($dbg_attr) {
4555 if ($line =~ /^.\s*$Modifier\s*$/) {
4566 if ($line =~ /^.\s*{/ &&
4568 if (ERROR("OPEN_BRACE",
4587 if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
4589 if ($path =~ m{//}) {
4593 if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) {
4600 if ($line =~ m{//}) {
4601 if (ERROR("C99_COMMENTS",
4605 if ($line =~ /\/\/(.*)$/) {
4618 if (defined $realline_next &&
4628 if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ &&
4647 if (!defined $suppress_export{$linenr} &&
4653 if (defined $suppress_export{$linenr} &&
4660 if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*($zero_initializer)\s*;/ &&
4662 if (ERROR("GLOBAL_INITIALISERS",
4669 if ($line =~ /^\+.*\bstatic\s.*=\s*($zero_initializer)\s*;/) {
4670 if (ERROR("INITIALISED_STATIC",
4688 next if ($type !~ /\bint\b/);
4689 next if ($type !~ /\b(?:short|long\s+long|long)\b/);
4694 $new_type = "unsigned $new_type" if ($type =~ /\bunsigned\b/);
4695 $new_type = "const $new_type" if ($type =~ /^const\b/);
4698 if (WARN("UNNECESSARY_INT",
4706 if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) {
4713if ($line =~ /^\+\s*const\s+(char|unsigned\s+char|_*u8|(?:[us]_)?int8_t)\s+\w+\s*\[\s*(?:\w+\s*)?\…
4714 if (WARN("STATIC_CONST_CHAR_ARRAY",
4722 if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) {
4729 if ($sline =~ /\bconst\s+($BasicType)\s+const\b/) {
4731 if ($sline =~ /\bconst\s+\Q$found\E\s+const\b\s*\*/) {
4742 if ($sline =~ /^\+\s*const\s+static\s+($Type)\b/ ||
4744 if (WARN("STATIC_CONST",
4753 if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) {
4760 if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) {
4762if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))…
4764 if (WARN("ARRAY_SIZE",
4773 if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) {
4774 if (ERROR("FUNCTION_WITHOUT_ARGS",
4783 if ($line =~ /\btypedef\s/ &&
4807 if ($from ne $to) {
4808 if (ERROR("POINTER_LOCATION",
4834 if ($from ne $to && $ident !~ /^$Modifier$/) {
4835 if (ERROR("POINTER_LOCATION",
4849if ($line =~ /\b(?!AA_|BUILD_|DCCP_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A…
4851 $msg_level = \&CHK if ($file);
4853 …nless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of…
4857 if ($line =~ /\bLINUX_VERSION_CODE\b/) {
4863 if ($line =~ /\bprintk_ratelimit\s*\(/) {
4869 if ($line =~ /\bprintk\s*\(\s*(?!KERN_[A-Z]+\b)/) {
4875 if ($line =~ /\b(printk(_once|_ratelimited)?)\s*\(\s*KERN_([A-Z]+)/) {
4879 $modifier = "" if (!defined($modifier));
4881 $level = "warn" if ($level eq "warning");
4883 $level2 = "dbg" if ($level eq "debug");
4891 if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
4894 $level = "warn" if ($level eq "warning");
4895 $level = "dbg" if ($level eq "debug");
4901 if ($line =~ /\b(trace_printk|trace_puts|ftrace_vprintk)\s*\(/) {
4903 …"Do not use $1() in production code (this can be ignored if built only with a debug config option)…
4909 if ($line =~ /\bENOSYS\b/) {
4917 if (!$file && $line =~ /\bENOTSUPP\b/) {
4918 if (WARN("ENOTSUPP",
4926 # or if closed on same line
4927 if ($perl_version_ok &&
4931 if (ERROR("OPEN_BRACE",
4941 if ($line2 !~ /^\s*$/) {
4948 if ($line =~ /^.\s*{/ &&
4950 if (ERROR("OPEN_BRACE",
4959 if ($fixedline !~ /^\+\s*$/) {
4966 if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident){1,2}[=\{]/) {
4967 if (WARN("SPACING",
4978 if ($line =~ /^.\s*($Declare)\((\s*)\*(\s*)($Ident)(\s*)\)(\s*)\(/) {
4990 if ($declare =~ /(\s+)$/) {
4994 if ($declare !~ /\*$/ && $post_declare_space =~ /^$/) {
5012 if (defined $pre_pointer_space &&
5019 if (defined $post_pointer_space &&
5026 if (defined $post_funcname_space &&
5033 if (defined $pre_args_space &&
5039 if (show_type("SPACING") && $fix) {
5051 if ($prefix !~ /$Type\s+$/ &&
5054 if (ERROR("BRACKET_SPACE",
5070 if ($name =~ /^(?:
5071 if|for|while|switch|return|case|
5077 # if there is a space between the name and the open
5084 # If this whole things ends with a type its most
5089 if (WARN("SPACING",
5099 if (!($line=~/\#\s*include/)) {
5141 if (length($opline) >= ($off + length($elements[$n + 1]))) {
5147 $a = 'V' if ($elements[$n] ne '');
5148 $a = 'W' if ($elements[$n] =~ /\s$/);
5149 $a = 'C' if ($elements[$n] =~ /$;$/);
5150 $a = 'B' if ($elements[$n] =~ /(\[|\()$/);
5151 $a = 'O' if ($elements[$n] eq '');
5152 $a = 'E' if ($ca =~ /^\s*$/);
5157 if (defined $elements[$n + 2]) {
5158 $c = 'V' if ($elements[$n + 2] ne '');
5159 $c = 'W' if ($elements[$n + 2] =~ /^\s/);
5160 $c = 'C' if ($elements[$n + 2] =~ /^$;/);
5161 $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/);
5162 $c = 'O' if ($elements[$n + 2] eq '');
5163 $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/);
5182 if ($op_type ne 'V' &&
5190 if ($ctx !~ /.x[WEBC]/ &&
5192 if (ERROR("SPACING",
5209 if ($ctx =~ /Wx.|.xW/) {
5210 if (ERROR("SPACING",
5213 if (defined $fix_elements[$n + 2]) {
5224 if ($ctx =~ /Wx./) {
5225 if (ERROR("SPACING",
5231 if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
5232 if (ERROR("SPACING",
5239 if ($rtrim_before || $space_after) {
5240 if ($rtrim_before) {
5245 if ($space_after) {
5260 if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
5261 if (ERROR("SPACING",
5263 if ($n != $last_after + 2) {
5269 if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
5273 if (ERROR("SPACING",
5276 if (defined $fix_elements[$n + 2]) {
5285 if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
5286 if (ERROR("SPACING",
5292 if ($ctx =~ /Wx[BE]/ ||
5294 if (ERROR("SPACING",
5300 if ($ctx =~ /ExW/) {
5301 if (ERROR("SPACING",
5304 if (defined $fix_elements[$n + 2]) {
5318 if ($check) {
5319 if (defined $fix_elements[$n + 2] && $ctx !~ /[EW]x[EW]/) {
5320 if (CHK("SPACING",
5327 if (CHK("SPACING",
5334 if (ERROR("SPACING",
5337 if (defined $fix_elements[$n + 2]) {
5347 if ($ctx =~ /Wx./ and $realfile !~ m@.*\.lds\.h$@) {
5348 if (ERROR("SPACING",
5360 if (($op eq '<' &&
5371 if (($op eq ':') &&
5377 if ($ok == 0) {
5379 $msg_level = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/);
5381 if (&{$msg_level}("SPACING",
5384 if (defined $fix_elements[$n + 2]) {
5398 if (($#elements % 2) == 0) {
5402 if ($fix && $line_fixed && $fixed_line ne $fixed[$fixlinenr]) {
5410 if ($line =~ /^\+.*\S\s+;\s*$/) {
5411 if (WARN("SPACING",
5420 if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
5427 ## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
5435 ## if ($ln =~ /,/) {
5441 #need space before brace following if, while, etc
5442 if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) ||
5444 if (ERROR("SPACING",
5452 ## if ($line =~ /^.\t+$Type\s+$Ident(?:\s*=.*)?;/ &&
5461 if ($line =~ /}(?!(?:,|;|\)|\}))\S/) {
5462 if (ERROR("SPACING",
5471 if ($line =~ /\[\s/ && $line !~ /\[\s*$/) {
5472 if (ERROR("SPACING",
5479 if ($line =~ /\s\]/) {
5480 if (ERROR("SPACING",
5489 if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
5491 if (ERROR("SPACING",
5498 if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
5501 if (ERROR("SPACING",
5514 if (CHK("UNNECESSARY_PARENTHESES",
5523 # but not "if (foo->bar) (" to avoid some false positives
5524 if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) {
5526 if (CHK("UNNECESSARY_PARENTHESES",
5535 # check for unnecessary parentheses around comparisons in if uses
5537 if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
5539 $stat =~ /(^.\s*if\s*($balanced_parens))/) {
5546 next if ($match =~ /^\s*\w+\s*$/);
5547 if (!defined($herectx)) {
5553 last if $rl =~ /^[ \+].*\{/;
5565 if ($sline =~ /^.\s+[A-Za-z_][A-Za-z\d_]*:(?!\s*\d+)/ &&
5568 if (WARN("INDENTED_LABEL",
5576 # check if a statement with a comma should be two statements like:
5579 if (defined($stat) &&
5588 if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) {
5590 if ($perl_version_ok &&
5594 if ($value =~ m/^\s*$FuncArg\s*(?:\?|$)/) {
5607 if ($sline =~ /^[ \+]}\s*$/ &&
5616 # if statements using unnecessary parentheses - ie: if ((foo == bar))
5617 if ($perl_version_ok &&
5622if ($line =~ /\bif\s*(?:\(\s*){$count,$count}$LvalOrFunc\s*($Compare)\s*$LvalOrFunc(?:\s*\)){$coun…
5624 $msg = " - maybe == should be = ?" if ($comp eq "==");
5634 if ($perl_version_ok &&
5641 if ($lead !~ /(?:$Operators|\.)\s*$/ &&
5646 if ($comp eq "<") {
5660 if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
5662 if ($name ne 'EOF' && $name ne 'ERROR' && $name !~ /^EPOLL/) {
5668 # Need a space before open parenthesis after if, while etc
5669 if ($line =~ /\b(if|while|for|switch)\(/) {
5670 if (ERROR("SPACING",
5674 s/\b(if|while|for|switch)\(/$1 \(/;
5678 # Check for illegal assignment in if conditional -- and check for trailing
5680 if ($line =~ /do\s*(?!{)/) {
5683 if (!defined $stat);
5689 if ($stat_next =~ /^\s*while\b/) {
5690 # If the statement carries leading newlines,
5701 if (!defined $suppress_whiletrailers{$linenr} &&
5703 $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
5707 if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
5708 if (ERROR("ASSIGN_IN_IF",
5709 "do not use assignment in if condition\n" . $herecurr) &&
5711if ($rawline =~ /^\+(\s+)if\s*\(\s*(\!)?\s*\(\s*(($Lval)\s*=\s*$LvalOrFunc)\s*\)\s*(?:($Compare)\s…
5721 my $newline = "${space}if (";
5722 $newline .= '!' if defined($not);
5723 $newline .= '(' if (defined $not && defined($test) && defined($against));
5725 $newline .= " $test $against" if (defined($test) && defined($against));
5726 $newline .= ')' if (defined $not && defined($test) && defined($against));
5728 $newline .= " {" if (defined($brace));
5740 if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
5749 . "\n" if ($cond_lines);
5750 if (defined($stat_real) && $cond_lines > 1) {
5754 if (ERROR("TRAILING_STATEMENTS",
5759 $fixed[$fixlinenr] =~ /^\+(\s*)((?:if|while|for)\s*$balanced_parens)\s*(.*)$/) {
5763 if ($rest =~ /;$/) {
5772 if ($line =~ /
5787 # if and else should not have general statements after it
5788 if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) {
5791 if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) {
5796 # if should not continue a brace
5797 if ($line =~ /}\s*if\b/) {
5799 "trailing statements should be on next line (or did you mean 'else if'?)\n" .
5803 if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
5815 if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ &&
5817 if (ERROR("ELSE_AFTER_BRACE",
5824 if ($fixedline !~ /^\+\s*$/) {
5833 if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ &&
5842 if ($s =~ /^\s*;/) {
5843 if (ERROR("WHILE_AFTER_BRACE",
5863 if ($var !~ /^$Constant$/ &&
5878 next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/);
5879 if ($check) {
5881 if (!$file && !$camelcase_file_seeded) {
5886 if (!defined $camelcase{$word}) {
5896 if ($line =~ /\#\s*define.*\\\s+$/) {
5897 if (WARN("WHITESPACE_AFTER_LINE_CONTINUATION",
5904 # warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes
5906 if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
5909 if (-f "$root/$checkfile" &&
5914 if ($asminclude > 0) {
5915 if ($realfile =~ m{^arch/}) {
5927 # first statement and ensure its the whole macro if its not enclosed
5929 if ($realfile !~ m@/vmlinux.lds.h$@ &&
5943 $has_flow_statement = 1 if ($ctx =~ /\b(goto|return)\b/);
5944 $has_arg_concat = 1 if ($ctx =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/);
5951 if (defined $define_args && $define_args ne "") {
5998 if ($dstat ne '' &&
6015 if ($dstat =~ /^\s*if\b/) {
6017 …"Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic d…
6034 if ($first) {
6045 # check if any macro arguments are reused (ignore '...' and 'type')
6047 next if ($arg =~ /\.\.\./);
6048 next if ($arg =~ /^type$/i);
6054 if ($use_cnt > 1) {
6058 # check if any macro arguments may have other precedence issues
6059 if ($tmp_stmt =~ m/($Operators)?\s*\b$arg\b\s*($Operators)?/m &&
6066 # check if this is an unused argument
6067 if ($define_stmt !~ /\b$arg\b/) {
6075 if ($has_flow_statement && !$has_arg_concat) {
6089 if ($prevline !~ /^..*\\$/ &&
6101 if ($perl_version_ok &&
6115if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*…
6123 if (($stmts =~ tr/;/;/) == 1 &&
6124 $stmts !~ /^\s*(if|while|for|switch)\b/) {
6128 if (defined $semis && $semis ne "") {
6142 # check for redundant bracing round if etc
6143 if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) {
6148 if ($#chunks > 0 && $level == 0) {
6157 # If the condition carries leading newlines, then count those as offsets.
6172 $seen++ if ($block =~ /^\s*{/);
6175 if (statement_lines($cond) > 1) {
6179 if ($block =~/\b(?:if|for|while)\b/) {
6183 if (statement_block_size($block) > 1) {
6189 if ($seen) {
6194 if ($sum_allowed == 0) {
6205 if (!defined $suppress_ifbraces{$linenr - 1} &&
6206 $line =~ /\b(if|while|for|else)\b/) {
6210 if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
6221 if (defined $cond) {
6224 if (statement_lines($cond) > 1) {
6228 if ($block =~/\b(?:if|for|while)\b/) {
6232 if (statement_block_size($block) > 1) {
6237 if (defined $chunks[1]) {
6239 if (defined $cond) {
6242 if ($block =~ /^\s*\{/) {
6247 if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) {
6257 if ($sline =~ /^.\s*\}\s*else\s*$/ ||
6263 if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) {
6264 if (CHK("BRACES",
6270 if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) {
6271 if (CHK("BRACES",
6280 if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
6289 if ($line =~ /^\+\s*$String/ &&
6292 if (WARN("SPLIT_STRING",
6299 if ($rawline =~ /\Q$extracted_string\E(\s*\)\s*;\s*$|\s*,\s*)/) {
6311 if ($fixedline !~ /\+\s*$/) {
6319 if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) {
6328 if ($line =~ /^\+.*$String/ &&
6339if ($rawline =~ /^\+.*\([^"]*"$tracing_logging_tags{0,3}%s(?:\s*\(\s*\)\s*)?$tracing_logging_tags{…
6340 if (WARN("TRACING_LOGGING",
6348 if ($rawline =~ /^.*\".*\s\\n/) {
6349 if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",
6358 if ($line =~ /$String[A-Z_]/ ||
6360 if (CHK("CONCATENATED_STRING",
6372 if ($line =~ /$String\s*[Lu]?"/) {
6373 if (WARN("STRING_FRAGMENTS",
6390 if ($show_L && $string =~ /%[\*\d\.\$]*L([diouxX])/) {
6396 if ($show_Z && $string =~ /%[\*\d\.\$]*Z([diouxX])/) {
6402 if ($string =~ /0x%[\*\d\.\$\Llzth]*[diou]/) {
6409 if ($rawline =~ /\\$/ && $sline =~ tr/"/"/ % 2) {
6414 # warn about #if 0
6415 if ($line =~ /^.\s*\#\s*if\s+0\b/) {
6417 "Consider removing the code enclosed by this #if 0 and its #endif\n" . $herecurr);
6420 # warn about #if 1
6421 if ($line =~ /^.\s*\#\s*if\s+1\b/) {
6423 "Consider removing the #if 1 and its #endif\n" . $herecurr);
6426 # check for needless "if (<foo>) fn(<foo>)" uses
6427 if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) {
6430if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?|(?:kmem_cache|mempool|dma_pool)_…
6432 if (WARN('NEEDLESS_IF',
6438 if ($lines[$linenr - 2] =~ /^\+(\t*)if\s*\(\s*$tested\s*\)\s*$/) {
6443 if ($lines[$linenr - 1] =~ /^\+(\t+)$func\s*\(\s*$tested\s*\)\s*;\s*$/) {
6445 if (length($leading_tabs) + 1 ne length($new_leading_tabs)) {
6451 if ($do_fix) {
6460 if ($line =~ /^\+.*\b$logFunctions\s*\(/ &&
6461 $prevline =~ /^[ \+]\s*if\s*\(\s*(\!\s*|NULL\s*==\s*)?($Lval)(\s*==\s*NULL\s*)?\s*\)/ &&
6470if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*…
6478 if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ &&
6481 if (WARN("UNNECESSARY_KERN_LEVEL",
6489 if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) {
6495 if (defined $stat &&
6506 if (WARN("UNNECESSARY_MODIFIER",
6517 if ($perl_version_ok &&
6519 $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so
6525 if ($perl_version_ok) {
6529 $equal = "" if ($4 eq "!=");
6530 if (CHK("COMPARISON_TO_NULL",
6539 if ($line =~ /(\b$InitAttribute\b)/) {
6541if ($line =~ /^\+\s*static\s+(?:const\s+)?(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Iden…
6544 if ((($ptr =~ /\b(union|struct)\s+$attr\b/ &&
6557 if ($line =~ /\bconst\b/ && $line =~ /($InitAttributeData)/) {
6562 if (ERROR("INIT_ATTRIBUTE",
6571 if ($line !~ /\bconst\b/ && $line =~ /($InitAttributeConst)/) {
6573 if (ERROR("INIT_ATTRIBUTE",
6579 $lead = "$lead " if ($lead !~ /^\+$/);
6586 if ($line =~ /\b__read_mostly\b/ &&
6588 if (ERROR("CONST_READ_MOSTLY",
6596 if ($realfile !~ m@^include/uapi/@ &&
6601 if (WARN("CONSTANT_CONVERSION",
6609 if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
6612 if (! ($delay < 10) ) {
6616 if ($delay > 2000) {
6623 if ($line =~ /\bmsleep\s*\((\d+)\);/) {
6624 if ($1 < 20) {
6631 if ($line =~ /\bjiffies\s*$Compare|$Compare\s*jiffies\b/) {
6637 if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) {
6643 # if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
6650 if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
6651 if (ERROR("SPACING",
6661 if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ ||
6664 if (!ctx_has_comment($first_line, $linenr)) {
6690 if ($line =~ /\b(?:$all_barriers)\s*\(/) {
6691 if (!ctx_has_comment($first_line, $linenr)) {
6699 if ($realfile !~ m@^include/asm-generic/@ &&
6708 if ($line =~ /\bwaitqueue_active\s*\(/) {
6709 if (!ctx_has_comment($first_line, $linenr)) {
6716 if ($line =~ /\bdata_race\s*\(/) {
6717 if (!ctx_has_comment($first_line, $linenr)) {
6724if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@inc…
6730 if ($line =~ /\b($Type)\s+($Storage)\b/) {
6735 if ($line =~ /\b$Storage\b/ &&
6745 if ($line =~ /\b$Type\s+$Inline\b/ ||
6752 if ($realfile !~ m@\binclude/uapi/@ &&
6754 if (WARN("INLINE",
6763 if ($realfile !~ m@\binclude/uapi/@ &&
6797 $params = $2 if defined($2);
6800 if (exists($attr_list{$curr_attr})) {
6802 if ($curr_attr eq "format" && $params) {
6808 if (WARN("PREFER_DEFINED_ATTRIBUTE_MACRO",
6821 if ($attr =~ /^_*unused/) {
6828 if ($perl_version_ok &&
6837 if ($realfile !~ m@\binclude/uapi/@ &&
6841 if ($type =~ /\b($typeC99Typedefs)\b/) {
6844 $kernel_type = 's' if ($type =~ /^_*[si]/);
6847 if (CHK("PREFER_KERNEL_TYPES",
6856 if ($line =~ /(\(\s*$C90_int_types\s*\)\s*)($Constant)\b/) {
6862 $suffix .= 'U' if ($cast =~ /\bunsigned\b/);
6863 if ($cast =~ /\blong\s+long\b/) {
6868 if (WARN("TYPECAST_INT_CONSTANT",
6876 if ($line =~ /\bsizeof\s*\(\s*\&/) {
6882 if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) {
6883 if (WARN("SIZEOF_PARENTHESIS",
6891 if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) {
6897 if ($sline =~ /\bseq_printf\s*\(.*"\s*\)\s*;\s*$/) {
6900 if ($fmt !~ /%/) {
6901 if (WARN("PREFER_SEQ_PUTS",
6910 if ($perl_version_ok &&
6930 if ($extension !~ /[4SsBKRraEehMmIiUDdgVCbGNOxtf]/ ||
6938 if ($extension eq "x" && !defined($stat_real)) {
6939 if (!defined($stat_real)) {
6943 …"Using vsprintf specifier '\%px' potentially exposes the kernel memory layout, if you don't really…
6946 if ($bad_specifier ne "") {
6951 if ($bad_specifier =~ /p[Ff]/) {
6953 $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
6966 if ($perl_version_ok &&
6974 if ($ms_size =~ /^(0x|)0$/i) {
6984 # if ($perl_version_ok &&
6987 # if (WARN("PREFER_ETHER_ADDR_COPY",
6988 # "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . "$her…
6995 # if ($perl_version_ok &&
7004 # if ($perl_version_ok &&
7010 # if ($ms_val =~ /^(?:0x|)0+$/i) {
7011 # if (WARN("PREFER_ETH_ZERO_ADDR",
7017 # if (WARN("PREFER_ETH_BROADCAST_ADDR",
7026 if ($line =~ /\bstrcpy\s*\(/) {
7032 if ($line =~ /\bstrlcpy\s*\(/) {
7038 if ($line =~ /\bstrncpy\s*\(/) {
7044 if ($line =~ /\bethtool_sprintf\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) {
7045 if (WARN("PREFER_ETHTOOL_PUTS",
7053 if ($rawline =~ /\bethtool_sprintf\s*\(\s*$FuncArg\s*,\s*\"\%s\"\s*,\s*$FuncArg\s*\)/) {
7054 if (WARN("PREFER_ETHTOOL_PUTS",
7063 if ($perl_version_ok &&
7066 if (defined $2 || defined $7) {
7074 if ($cast1 ne "" && $cast2 ne "" && $cast1 ne $cast2) {
7087 if ($perl_version_ok &&
7092 if ($min eq $max) {
7103 if ($perl_version_ok &&
7117 if ($perl_version_ok &&
7123 if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) {
7126 if ($count == 1 &&
7135 if ($realfile =~ /\.h$/ &&
7137 if (CHK("AVOID_EXTERNS",
7145 if ($realfile =~ /\.c$/ && defined $stat &&
7152 if (defined $cond) {
7155 if ($s =~ /^\s*;/)
7161 if ($paren_space =~ /\n/) {
7174 if $st_name =~ /$s/;
7189 if (defined $stat &&
7195 if ($arg =~ /^$Type$/ && $arg !~ /enum\s+$Ident$/) {
7203 if ($perl_version_ok &&
7215 $ok = 1 if ($rl =~ /^[ \+]\{/);
7216 $ok = 1 if ($rl =~ /\{/ && $n == 0);
7217 last if $rl =~ /^[ \+].*\{/;
7219 if (!$ok) {
7226 if ($rawline =~ /\b__setup\("([^"]*)"/) {
7229 if (!grep(/$name/, @setup_docs)) {
7236 if ($line =~ /\*\s*\)\s*$allocFunctions\b/) {
7243 if ($perl_version_ok &&
7250 if ($perl_version_ok &&
7257 $newfunc = "kvmalloc_array" if ($oldfunc eq "kvmalloc");
7258 $newfunc = "kvcalloc" if ($oldfunc eq "kvzalloc");
7259 $newfunc = "kcalloc" if ($oldfunc eq "kzalloc");
7262 if ($a1 =~ /^sizeof\s*\S/) {
7266 if ($r1 !~ /^sizeof\b/ && $r2 =~ /^sizeof\s*\S/ &&
7271 if (WARN("ALLOC_WITH_MULTIPLY",
7281 if ($perl_version_ok &&
7289 if ($line =~ /\b((?:devm_)?((?:k|kv)?(calloc|malloc_array)(?:_node)?))\s*\(\s*sizeof\b/) {
7295 if ($line =~ /;\s*;\s*$/) {
7296 if (WARN("ONE_SEMICOLON",
7304 if ($realfile !~ m@^include/uapi/@ &&
7307 $ull = "_ULL" if (defined($1) && $1 =~ /ll/i);
7308 if (CHK("BIT_MACRO",
7316 if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^${CONFIG_}/) {
7321 # check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
7322if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(${CONFIG_}[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:…
7324 if (WARN("PREFER_IS_ENABLED",
7327 $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)";
7341 if ($raw_comment ne '') {
7343 if ($raw_comment =~ /$ft/) {
7345 $msg_level = \&CHK if ($file);
7354 if ($perl_version_ok &&
7365 if ($line =~ /\b__FUNCTION__\b/) {
7366 if (WARN("USE_FUNC",
7380 if ($line =~ /\byield\s*\(\s*\)/) {
7386 if ($line =~ /\+\s*(.*?)\b(true|false|$Lval)\s*(==|\!=)\s*(true|false|$Lval)\b(.*)$/i) {
7394 ($arg, $otype) = ($otype, $arg) if ($arg =~ /^(?:true|false)$/i);
7397 if ($type =~ /^(?:true|false)$/) {
7398 if (("$test" eq "==" && "$type" eq "true") ||
7413 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
7419 if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) {
7425 if ($line =~ /^.\s*__initcall\s*\(/) {
7431 if ($line =~ /\bspin_is_locked\(/) {
7437 if ($line =~ /\b($deprecated_apis_search)\b\s*\(/) {
7446 if (defined($const_structs) &&
7456 if ($line =~ /\bNR_CPUS\b/ &&
7457 $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
7469 if ($line =~ /\+\s*#\s*define\s+((?:__)?ARCH_(?:HAS|HAVE)\w*)\b/) {
7475 if ($perl_version_ok &&
7482 if ($line =~ /\breturn\s+sysfs_emit\s*\(\s*$FuncArg\s*,\s*($String)/ &&
7485 if (WARN("SYSFS_EMIT",
7493 if ($sline =~ /^[\+ ]\s*\}(?:\s*__packed)?\s*;\s*$/ &&
7495 if (ERROR("FLEXIBLE_ARRAY",
7503 if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) {
7509 if ($line =~ /\bin_atomic\s*\(/) {
7510 if ($realfile =~ m@^drivers/@) {
7536 if ($line =~ /\b($rcu_trace_funcs)\s*\(/) {
7537 if ($realfile !~ m{^$rcu_trace_paths}) {
7544 if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
7546 if ($realfile !~ m@^kernel/lockdep@ &&
7554 if ($line =~ /debugfs_create_\w+.*\b$mode_perms_world_writable\b/ ||
7561 # and whether or not function naming is typical and if
7563 if ($perl_version_ok &&
7571 if ($show =~ /^${var}_show$/ &&
7574 if (WARN("DEVICE_ATTR_RW",
7582 if (WARN("DEVICE_ATTR_RO",
7590 if (WARN("DEVICE_ATTR_WO",
7599 $newshow = "${var}_show" if ($show ne "NULL" && $show ne "${var}_show");
7601 $newstore = "${var}_store" if ($store ne "NULL" && $store ne "${var}_store");
7603 if ($show ne $newshow) {
7606 if ($store ne $newstore) {
7623 if ($perl_version_ok &&
7635 if ($arg_pos > 1) {
7640 if ($stat =~ /$test/) {
7642 $val = $6 if ($skip_args ne "");
7643 if (!($func =~ /^(?:module_param|proc_create)/ && $val eq "0") &&
7649 if ($val =~ /^$Octal$/ && (oct($val) & 02)) {
7661 if (WARN("SYMBOLIC_PERMS",
7669 if ($line =~ /\bMODULE_LICENSE\s*\(\s*($String)\s*\)/) {
7680 if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) {
7684 if (!$file && $extracted_string eq '"GPL v2"') {
7685 if (WARN("MODULE_LICENSE",
7694 if ($line =~ /\.extra[12]\s*=\s*&(zero|one|int_max)\b/) {
7700 # If we have no input at all, then there is nothing to report on
7702 if ($#rawlines == -1) {
7708 if ($mailback && ($clean == 1 || !$is_patch)) {
7714 if (!$chk_patch && !$is_patch) {
7718 if (!$is_patch && $filename !~ /cover-letter\.patch$/) {
7722 if ($is_patch && $has_commit_log && $chk_fixes_tag) {
7723 if ($needs_fixes_tag ne "" && !$is_revert && !$fixes_tag) {
7728 if ($is_patch && $has_commit_log && $chk_signoff) {
7729 if ($signoff == 0) {
7743 if ($authorsignoff == 0) {
7763 if ($summary && !($clean == 1 && $quiet == 1)) {
7764 print "$filename " if ($summary_file);
7770 if ($quiet == 0) {
7771 # If there were any defects found and not already fixing them
7772 if (!$clean and !$fix) {
7779 # If there were whitespace errors which cleanpatch can fix
7781 if ($rpt_cleaners) {
7791 if ($clean == 0 && $fix &&
7795 $newfile .= ".EXPERIMENTAL-checkpatch-fixes" if (!$fix_inplace);
7805 if ($file) {
7806 if ($linecount > 3) {
7816 if (!$quiet) {
7830 if ($quiet == 0) {
7832 if ($clean == 1) {