Lines Matching full:my

18 my $P = $0;
19 my $D = dirname(abs_path($P));
21 my $V = '0.32';
25 my $quiet = 0;
26 my $verbose = 0;
27 my %verbose_messages = ();
28 my %verbose_emitted = ();
29 my $tree = 1;
30 my $chk_signoff = 1;
31 my $chk_fixes_tag = 1;
32 my $chk_patch = 1;
33 my $tst_only;
34 my $emacs = 0;
35 my $terse = 0;
36 my $showfile = 0;
37 my $file = 0;
38 my $git = 0;
39 my %git_commits = ();
40 my $check = 0;
41 my $check_orig = 0;
42 my $summary = 1;
43 my $mailback = 0;
44 my $summary_file = 0;
45 my $show_types = 0;
46 my $list_types = 0;
47 my $fix = 0;
48 my $fix_inplace = 0;
49 my $root;
50 my $gitroot = $ENV{'GIT_DIR'};
52 my %debug;
53 my %camelcase = ();
54 my %use_type = ();
55 my @use = ();
56 my %ignore_type = ();
57 my @ignore = ();
58 my $help = 0;
59 my $configuration_file = ".checkpatch.conf";
60 my $max_line_length = 100;
61 my $ignore_perl_version = 0;
62 my $minimum_perl_version = 5.10.0;
63 my $min_conf_desc_length = 4;
64 my $spelling_file = "$D/spelling.txt";
65 my $codespell = 0;
66 my $codespellfile = "/usr/share/codespell/dictionary.txt";
67 my $user_codespellfile = "";
68 my $conststructsfile = "$D/const_structs.checkpatch";
69 my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst";
70 my $typedefsfile;
71 my $color = "auto";
72 my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
74 my $git_command ='export LANGUAGE=en_US.UTF-8; git';
75 my $tabsize = 8;
76 my ${CONFIG_} = "CONFIG_";
78 my %maybe_linker_symbol; # for externs in c exceptions, when seen in *vmlinux.lds.h
81 my ($exitcode) = @_;
154 my %seen;
159 my ($exitcode) = @_;
161 my $count = 0;
165 open(my $script, '<', abs_path($P)) or
168 my $text = <$script>;
171 my %types = ();
198 foreach my $type (sort keys %types) {
199 my $orig_type = $type;
201 my $level = $types{$type};
212 my $message = $verbose_messages{$orig_type};
221 my $conf = which_conf($configuration_file);
223 my @conf_args;
224 open(my $conffile, '<', "$conf")
228 my $line = $_;
237 my @words = split(" ", $line);
238 foreach my $word (@words) {
248 open(my $docs, '<', "$docsfile")
251 my $type = '';
252 my $desc = '';
253 my $in_desc = 0;
257 my $line = $_;
343 my $python_codespell_dict = << "EOF";
352 my $codespell_dict = `python3 -c "$python_codespell_dict" 2> /dev/null`;
382 my $exit = 0;
384 my $perl_version_ok = 1;
400 my ($hashRef, $arrayRef) = @_;
402 my @array = split(/,/, join(',', @$arrayRef));
403 foreach my $word (@array) {
417 my ($hashRef, $prefix) = @_;
421 foreach my $word (sort keys %$hashRef) {
431 my $dbg_values = 0;
432 my $dbg_possible = 0;
433 my $dbg_type = 0;
434 my $dbg_attr = 0;
435 for my $key (keys %debug) {
441 my $rpt_cleaners = 0;
468 my $emitted_corrupt = 0;
634 foreach my $entry (@link_tags) {
670 my (@arr) = @_;
671 my $len = scalar @arr;
676 my $min = $arr[0];
677 for my $i (0 .. ($len-1)) {
686 my ($str1, $str2) = @_;
691 my $len1 = length($str1);
692 my $len2 = length($str2);
694 my @distance;
695 for my $i (0 .. $len1) {
696 for my $j (0 .. $len2) {
704 my $dist1 = $distance[$i][$j - 1]; #insert distance
705 my $dist2 = $distance[$i - 1][$j]; # remove
706 my $dist3 = $distance[$i - 1][$j - 1]; #replace
715 my ($sign_off) = @_;
716 my @standard_signature_tags = (
720 foreach my $signature (@standard_signature_tags) {
826 my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';
830 foreach my $entry (@mode_permission_funcs) {
845 foreach my $entry (keys %deprecated_apis) {
880 foreach my $entry (keys %mode_permission_string_types) {
891 my ($string) = @_;
895 my $val = "";
896 my $oval = "";
897 my $to = 0;
898 my $curpos = 0;
899 my $lastpos = 0;
902 my $match = $2;
903 my $omatch = $1;
925 my $misspellings;
926 my %spelling_fix;
928 if (open(my $spelling, '<', $spelling_file)) {
930 my $line = $_;
938 my ($suspect, $fix) = split(/\|\|/, $line);
948 if (open(my $spelling, '<', $codespellfile)) {
950 my $line = $_;
961 my ($suspect, $fix) = split(/->/, $line);
974 my ($wordsRef, $file) = @_;
976 if (open(my $words, '<', $file)) {
978 my $line = $_;
1000 my $const_structs;
1007 my $typeOtherTypedefs;
1014 my $mods = "(?x: \n" . join("|\n ", (@modifierList, @modifierListFile)) . "\n)";
1015 my $all = "(?x: \n" . join("|\n ", (@typeList, @typeListFile)) . "\n)";
1016 my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)";
1017 my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)";
1088 my ($string) = @_;
1102 my ($file) = @_;
1108 open(my $include_file, '<', "$file")
1110 my $text = <$include_file>;
1113 my @lines = split('\n', $text);
1115 foreach my $line (@lines) {
1130 my ($filename) = @_;
1142 my ($license) = @_;
1146 my $root_path = abs_path($root);
1147 my $status = `cd "$root_path"; echo "$license" | scripts/spdxcheck.py -`;
1152 my $camelcase_seeded = 0;
1156 my $files;
1157 my $camelcase_cache = "";
1158 my @include_files = ();
1163my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include…
1167 my $last_mod_date = 0;
1170 foreach my $file (@include_files) {
1171 my $date = POSIX::strftime("%Y%m%d%H%M",
1179 open(my $camelcase_file, '<', "$camelcase_cache")
1195 foreach my $file (@include_files) {
1201 open(my $camelcase_file, '>', "$camelcase_cache")
1211 my ($filename) = @_;
1215 my $output = `${git_command} ls-files -- $filename 2>/dev/null`;
1216 my $count = $output =~ tr/\n//;
1221 my ($commit, $id, $desc) = @_;
1225 my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`;
1227 my @lines = split("\n", $output);
1255 my @rawlines = ();
1256 my @lines = ();
1257 my @fixed = ();
1258 my @fixed_inserted = ();
1259 my @fixed_deleted = ();
1260 my $fixlinenr = -1;
1267 my @commits = ();
1268 foreach my $commit_expr (@ARGV) {
1269 my $git_range;
1277 my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`;
1278 foreach my $line (split(/\n/, $lines)) {
1281 my $sha1 = $1;
1282 my $subject = $2;
1291 my $vname;
1293 for my $filename (@ARGV) {
1294 my $FILE;
1295 my $is_git_file = git_is_single_file($filename);
1296 my $oldfile = $file;
1368 my ($root) = @_;
1370 my @tree_check = (
1376 foreach my $check (@tree_check) {
1385 my ($formatted_email) = @_;
1387 my $name = "";
1388 my $quoted = "";
1389 my $name_comment = "";
1390 my $address = "";
1391 my $comment = "";
1444 my ($name, $name_comment, $address, $comment) = @_;
1446 my $formatted_email;
1472 my ($email) = @_;
1474 my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
1479 my ($email1, $email2) = @_;
1481 my ($email1_name, $name1_comment, $email1_address, $comment1) = parse_email($email1);
1482 my ($email2_name, $name2_comment, $email2_address, $comment2) = parse_email($email2);
1491 my ($bin) = @_;
1493 foreach my $path (split(/:/, $ENV{PATH})) {
1503 my ($conf) = @_;
1505 foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
1515 my ($str) = @_;
1517 my $res = '';
1518 my $n = 0;
1519 for my $c (split(//, $str)) {
1535 (my $res = shift) =~ tr/\t/ /c;
1540 my ($line) = @_;
1547 my ($white) = ($line =~ /^(\s*)/);
1552 my $sanitise_quote = '';
1555 my ($in_comment) = @_;
1564 my ($line) = @_;
1566 my $res = '';
1567 my $l = '';
1569 my $qlen = 0;
1570 my $off = 0;
1571 my $c;
1639 my $clean = 'X' x length($1);
1644 my $clean = 'X' x length($1);
1649 my $match = $1;
1657 my ($line, $rawline) = @_;
1665 my ($linenr, $remain, $off) = @_;
1666 my $line = $linenr - 1;
1667 my $blk = '';
1668 my $soff = $off;
1669 my $coff = $off - 1;
1670 my $coff_set = 0;
1672 my $loff = 0;
1674 my $type = '';
1675 my $level = 0;
1676 my @stack = ();
1677 my $p;
1678 my $c;
1679 my $len = 0;
1681 my $remainder;
1786 my $statement = substr($blk, $soff, $off - $soff + 1);
1787 my $condition = substr($blk, $soff, $coff - $soff + 1);
1799 my ($stmt) = @_;
1806 my @stmt_lines = ($stmt =~ /\n/g);
1812 my ($stmt) = @_;
1814 my @stmt_lines = ($stmt =~ /\n/g);
1820 my ($stmt) = @_;
1828 my @stmt_lines = ($stmt =~ /\n/g);
1829 my @stmt_statements = ($stmt =~ /;/g);
1831 my $stmt_lines = $#stmt_lines + 2;
1832 my $stmt_statements = $#stmt_statements + 1;
1842 my ($linenr, $remain, $off) = @_;
1843 my ($statement, $condition, $level);
1845 my (@chunks);
1871 my ($linenr, $remain, $outer, $open, $close, $off) = @_;
1872 my $line;
1873 my $start = $linenr - 1;
1874 my $blk = '';
1875 my @o;
1876 my @c;
1877 my @res = ();
1879 my $level = 0;
1880 my @stack = ($level);
1896 foreach my $c (split(//, $lines[$line])) {
1921 my ($linenr, $remain) = @_;
1923 my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0);
1927 my ($linenr, $remain) = @_;
1929 my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0);
1933 my ($linenr, $remain, $off) = @_;
1935 my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off);
1939 my ($linenr, $remain) = @_;
1944 my ($linenr, $remain, $off) = @_;
1950 my ($first_line, $end_line) = @_;
1953 my ($current_comment) = ($rawlines[$end_line - 1] =~ m@^\+.*(//.*$)@);
1966 my $in_comment = 0;
1968 for (my $linenr = $first_line; $linenr < $end_line; $linenr++) {
1969 my $line = $rawlines[$linenr - 1];
1990 my ($first_line, $end_line) = @_;
1991 my $cmt = ctx_locate_comment($first_line, $end_line);
2000 my ($linenr, $cnt) = @_;
2002 my $offset = $linenr - 1;
2005 my $line;
2016 my ($linenr, $lc) = @_;
2018 my $stat_real = raw_line($linenr, 0);
2019 for (my $count = $linenr + 1; $count <= $lc; $count++) {
2027 my ($linenr, $cnt, $here) = @_;
2029 my $herectx = $here . "\n";
2030 for (my $n = 0; $n < $cnt; $n++) {
2038 my ($vet) = @_;
2039 my ($res, $coded);
2054 my $av_preprocessor = 0;
2055 my $av_pending;
2056 my @av_paren_type;
2057 my $av_pend_colon;
2067 my ($stream, $type) = @_;
2069 my $res;
2070 my $var = '_' x length($stream);
2071 my $cur = $stream;
2176 my $new_type = pop(@av_paren_type);
2236 my $variant;
2267 my ($possible, $line) = @_;
2268 my $notPermitted = qr{(?:
2296 for my $modifier (split(' ', $possible)) {
2313 my $prefix = '';
2316 my ($type) = @_;
2326 my ($level, $type, $msg) = @_;
2332 my $output = '';
2351 my @lines = split("\n", $output, -1);
2376 my ($lineRef, $offset, $length) = @_;
2379 my $o = $1;
2380 my $l = $2;
2381 my $no = $o + $offset;
2382 my $nl = $l + $length;
2388 my ($linesRef, $insertedRef, $deletedRef) = @_;
2390 my $range_last_linenr = 0;
2391 my $delta_offset = 0;
2393 my $old_linenr = 0;
2394 my $new_linenr = 0;
2396 my $next_insert = 0;
2397 my $next_delete = 0;
2399 my @lines = ();
2401 my $inserted = @{$insertedRef}[$next_insert++];
2402 my $deleted = @{$deletedRef}[$next_delete++];
2404 foreach my $old_line (@{$linesRef}) {
2405 my $save_line = 1;
2406 my $line = $old_line; #don't modify the array
2439 my ($linenr, $line) = @_;
2441 my $inserted = {
2449 my ($linenr, $line) = @_;
2451 my $deleted = {
2460 my ($type, $msg) = @_;
2470 my ($type, $msg) = @_;
2480 my ($type, $msg) = @_;
2491 my ($absolute, $herecurr) = @_;
2492 my $file = $absolute;
2508 my $prefix = $absolute;
2519 my ($string) = @_;
2527 my ($string) = @_;
2535 my ($string) = @_;
2543 my ($string, $find, $replace) = @_;
2551 my ($leading) = @_;
2553 my $source_indent = $tabsize;
2554 my $max_spaces_before_tab = $source_indent - 1;
2555 my $spaces_to_tab = " " x $source_indent;
2566 my ($line) = @_;
2568 my $pos = 0;
2570 my $opens = $line =~ tr/\(/\(/;
2571 my $closes = $line =~ tr/\)/\)/;
2573 my $last_openparen = 0;
2579 my $len = length($line);
2582 my $string = substr($line, $pos);
2596 my ($line, $rawline) = @_;
2597 my $comment = '';
2599 for my $i (0 .. (length($line) - 1)) {
2609 my ($realfile) = @_;
2618 my $filename = shift;
2620 my $linenr=0;
2621 my $prevline="";
2622 my $prevrawline="";
2623 my $stashline="";
2624 my $stashrawline="";
2626 my $length;
2627 my $indent;
2628 my $previndent=0;
2629 my $stashindent=0;
2632 my $signoff = 0;
2633 my $fixes_tag = 0;
2634 my $is_revert = 0;
2635 my $needs_fixes_tag = "";
2636 my $author = '';
2637 my $authorsignoff = 0;
2638 my $author_sob = '';
2639 my $is_patch = 0;
2640 my $is_binding_patch = -1;
2641 my $in_header_lines = $file ? 0 : 1;
2642 my $in_commit_log = 0; #Scanning lines before patch
2643 my $has_patch_separator = 0; #Found a --- line
2644 my $has_commit_log = 0; #Encountered lines before patch
2645 my $commit_log_lines = 0; #Number of commit log lines
2646 my $commit_log_possible_stack_dump = 0;
2647 my $commit_log_long_line = 0;
2648 my $commit_log_has_diff = 0;
2649 my $reported_maintainer_file = 0;
2650 my $non_utf8_charset = 0;
2652 my $last_git_commit_id_linenr = -1;
2654 my $last_blank_line = 0;
2655 my $last_coalesced_string_linenr = -1;
2664 my $realfile = '';
2665 my $realline = 0;
2666 my $realcnt = 0;
2667 my $here = '';
2668 my $context_function; #undef'd unless there's a known function
2669 my $in_comment = 0;
2670 my $comment_edge = 0;
2671 my $first_line = 0;
2672 my $p1_prefix = '';
2674 my $prev_values = 'E';
2677 my %suppress_ifbraces;
2678 my %suppress_whiletrailers;
2679 my %suppress_export;
2680 my $suppress_statement = 0;
2682 my %signatures = ();
2687 my @setup_docs = ();
2688 my $setup_docs = 0;
2690 my $camelcase_file_seeded = 0;
2692 my $checklicenseline = 1;
2695 my $line;
2696 foreach my $rawline (@rawlines) {
2722 my $edge;
2723 my $cnt = $realcnt;
2724 for (my $ln = $linenr + 1; $cnt > 0; $ln++) {
2778 foreach my $line (@lines) {
2781 my $sline = $line; #copy of $line
2784 my $rawline = $rawlines[$linenr - 1];
2785 my $raw_comment = get_raw_comment($line, $rawline);
2798 my $context = $4;
2842 my $hunk_line = ($realcnt != 0);
2847 my $found_file = 0;
2897 my $last_binding_patch = $is_binding_patch;
2913 my $hereline = "$here\n$rawline\n";
2914 my $herecurr = "$here\n$rawline\n";
2915 my $hereprev = "$here\n$prevrawline\n$rawline\n";
2944 my $permhere = $here . "FILE: $realfile\n";
2955 my $curline = $linenr;
2972 my $ctx = $1;
2973 my ($email_name, $email_comment, $email_address, $comment1) = parse_email($ctx);
2974 my ($author_name, $author_comment, $author_address, $comment2) = parse_email($author);
2986 my $address1 = $email_address;
2987 my $address2 = $author_address;
3018 my $space_before = $1;
3019 my $sign_off = $2;
3020 my $space_after = $3;
3021 my $email = $4;
3022 my $ucfirst_sign_off = ucfirst(lc($sign_off));
3025 my $suggested_signature = find_standard_signature($sign_off);
3063 my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
3064 my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment));
3069 my $dequoted = $suggested_email;
3083 my $stripped_address = $email_address;
3094 my $comment_count = () = $name_comment =~ /\([^\)]+\)/g;
3107 my $cur_name = $email_name;
3108 my $new_comment = $comment;
3119 my $new_email = "$email_address$new_comment";
3128 my $new_comment = $comment;
3138 my $new_email = format_email($email_name, $name_comment, $email_address, $new_comment);
3149 my $sig_nospace = $line;
3203 my $tag = $1;
3204 my $orig_commit = $2;
3205 my $title;
3206 my $title_has_quotes = 0;
3220 my $tag_case = not ($tag eq "Fixes:");
3221 my $tag_space = not ($line =~ /^fixes:? [0-9a-f]{5,40} ($balanced_parens)/i);
3223 my $id_length = not ($orig_commit =~ /^[0-9a-f]{12,40}$/i);
3224 my $id_case = not ($orig_commit !~ /[A-F]/);
3226 my $id = "0123456789ab";
3227 my ($cid, $ctitle) = git_commit_info($orig_commit, $id,
3231 my $fixed = "Fixes: $cid (\"$ctitle\")";
3304 my $tag = $1;
3305 my $value = $2;
3339 my $init_char = "c";
3340 my $orig_commit = "";
3341 my $short = 1;
3342 my $long = 0;
3343 my $case = 1;
3344 my $space = 1;
3345 my $id = '0123456789ab';
3346 my $orig_desc = "commit description";
3347 my $description = "";
3348 my $herectx = $herecurr;
3349 my $has_parens = 0;
3350 my $has_quotes = 0;
3352 my $input = $line;
3354 for (my $n = 0; $n < 2; $n++) {
3433 my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/);
3435 my $blank = copy_spacing($rawline);
3436 my $ptr = substr($blank, 0, length($utf8_prefix)) . "^";
3437 my $hereptr = "$hereline$ptr\n";
3470 my $file = $1;
3485 my $typo = $1;
3486 my $blank = copy_spacing($rawline);
3487 my $ptr = substr($blank, 0, $-[1]) . "^" x length($typo);
3488 my $hereptr = "$hereline$ptr\n";
3489 my $typo_fix = $spelling_fix{lc($typo)};
3492 my $msg_level = \&WARN;
3504 my $id;
3505 my $description;
3520 my $first = $1;
3521 my $second = $2;
3522 my $start_pos = $-[1];
3523 my $end_pos = $+[2];
3533 my $start_char = '';
3534 my $end_char = '';
3556 my $last_word = $1;
3572 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
3579 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
3594 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
3595 my $msg_level = \&ERROR;
3609 my $ln = $linenr;
3610 my $needs_help = 0;
3611 my $has_help = 0;
3612 my $help_length = 0;
3614 my $f = $lines[$ln++];
3646 my $stat_real = get_stat_real($linenr, $ln - 1);
3664 my $preferred_order = 'MRLSWQBCPTFXNK';
3668 my $cur = $1;
3669 my $curval = $2;
3671 my $prev = $1;
3672 my $prevval = $2;
3673 my $curindex = index($preferred_order, $cur);
3674 my $previndex = index($preferred_order, $prev);
3694 my $flag = $1;
3695 my $replacement = {
3711 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
3713 my $dt_path = $root . "/Documentation/devicetree/bindings/";
3714 my $vp_file = $dt_path . "vendor-prefixes.yaml";
3716 foreach my $compat (@compats) {
3717 my $compat2 = $compat;
3719 my $compat3 = $compat;
3728 my $vendor = $1;
3742 my $comment = "";
3766 my $spdx_license = $1;
3773 my $msg_level = \&WARN;
3825 my $msg_type = "LONG_LINE";
3865 my $msg_level = \&WARN;
3895 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
3906 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
3919 my $operator = $1;
3931 my $operator = $1;
3937 my $line_end = substr($prevrawline, $-[0]);
3946 my $indent = length($1);
3960 my $oldindent = $1;
3961 my $rest = $2;
3963 my $pos = pos_last_openparen($rest);
3966 my $newindent = $2;
3968 my $goodtabindent = $oldindent .
3971 my $goodspaceindent = $oldindent . " " x $pos;
4029 my $oldindent;
4038 my $newindent = $1;
4083 my $sl = $sline;
4084 my $pl = $prevline;
4131 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
4163 my $tabs = length($1) + 1;
4177 my $tabs = $1;
4200 my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
4214 my $frag = $stat; $frag =~ s/;+\s*$//;
4228 my $s = $stat;
4241 my $type = $1;
4259 my ($name_len) = length($1);
4261 my $ctx = $s;
4265 for my $arg (split(/\s*,\s*/, $ctx)) {
4282 my $err = '';
4283 my $sep = '';
4284 my @ctx = ctx_block_outer($linenr, $realcnt);
4286 for my $ctx (@ctx) {
4287 my ($clen, $cindent) = line_stats($ctx);
4305 my $pre_ctx = "$1$2";
4307 my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
4314 my $ctx_cnt = $realcnt - $#ctx - 1;
4315 my $ctx = join("\n", @ctx);
4317 my $ctx_ln = $linenr;
4318 my $ctx_skip = $realcnt;
4340 my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
4354 my ($s, $c) = ($stat, $cond);
4363 my @newlines = ($c =~ /\n/gs);
4364 my $cond_lines = 1 + $#newlines;
4379 my $continuation = 0;
4380 my $check = 0;
4398 my $cond_ptr = -1;
4424 my (undef, $sindent) = line_stats("+" . $s);
4425 my $stat_real = raw_line($linenr, $cond_lines);
4451 my $opline = $line; $opline =~ s/^./ /;
4452 my ($curr_values, $curr_vars) =
4456 my $outline = $opline; $outline =~ s/\t/ /g;
4470 my $var = $1;
4481 my $ref = $1;
4491 my $type = $1;
4492 my $var = $2;
4495 my $sign = $1;
4496 my $pointer = $2;
4503 my $decl = trim($sign) . " int ";
4504 my $comp_pointer = $pointer;
4544 my $fixedline = $prevrawline;
4559 my $path = $1;
4575 my $line = $fixed[$fixlinenr];
4577 my $comment = trim($1);
4597 my $name = $1;
4651 my $tmp = trim($1);
4658 my $type = trim($1);
4661 my $new_type = $type;
4701 my $found = $1;
4732 my $array = $1;
4734 my $array_div = $1;
4767 my ($ident, $from, $to) = ($1, $2, $2);
4782 my $sub_from = $ident;
4783 my $sub_to = $ident;
4792 my ($match, $from, $to, $ident) = ($1, $2, $2, $3);
4810 my $sub_from = $match;
4811 my $sub_to = $match;
4821 my $msg_level = \&WARN;
4847 my $printk = $1;
4848 my $modifier = $2;
4849 my $orig = $3;
4851 my $level = lc($orig);
4853 my $level2 = $level;
4863 my $orig = $1;
4864 my $level = lc($orig);
4906 my $fixed_line = $rawline;
4908 my $line1 = $1;
4909 my $line2 = $2;
4926 my $fixedline = rtrim($prevrawline) . " {";
4950 my $declare = $1;
4951 my $pre_pointer_space = $2;
4952 my $post_pointer_space = $3;
4953 my $funcname = $4;
4954 my $post_funcname_space = $5;
4955 my $pre_args_space = $6;
4960 my $post_declare_space = "";
5021 my ($where, $prefix) = ($-[1], $1);
5036 my $name = $1;
5037 my $ctx_before = substr($line, 0, $-[1]);
5038 my $ctx = "$ctx_before$name";
5071 my $fixed_line = "";
5072 my $line_fixed = 0;
5074 my $ops = qr{
5081 my @elements = split(/($ops|;)/, $opline);
5084 ## foreach my $el (@elements) {
5088 my @fix_elements = ();
5089 my $off = 0;
5091 foreach my $el (@elements) {
5098 my $blank = copy_spacing($opline);
5099 my $last_after = -1;
5101 for (my $n = 0; $n < $#elements; $n += 2) {
5103 my $good = $fix_elements[$n] . $fix_elements[$n + 1];
5110 my $ca = substr($opline, 0, $off);
5111 my $cc = '';
5115 my $cb = "$ca$;$cc";
5117 my $a = '';
5125 my $op = $elements[$n + 1];
5127 my $c = '';
5139 my $ctx = "${a}x${c}";
5141 my $at = "(ctx:$ctx)";
5143 my $ptr = substr($blank, 0, $off) . "^";
5144 my $hereptr = "$hereline$ptr\n";
5147 my $op_type = substr($curr_values, $off + 1, 1);
5150 my $opv = $op . substr($curr_vars, $off, 1);
5193 my $rtrim_before = 0;
5194 my $space_after = 0;
5328 my $ok = 0;
5349 my $msg_level = \&ERROR;
5403 ## my $ln = $line;
5484 my $var = $1;
5496 my $var = $2;
5500 my $var2 = deparenthesize($var);
5511 my $if_stat = $1;
5512 my $test = substr($2, 1, -1);
5513 my $herectx;
5515 my $match = $1;
5520 my $cnt = statement_rawlines($if_stat);
5521 for (my $n = 0; $n < $cnt; $n++) {
5522 my $rl = raw_line($linenr, $n);
5552 my $cnt = statement_rawlines($stat);
5553 my $herectx = get_stat_here($linenr, $cnt, $here);
5560 my $spacing = $1;
5563 my $value = $1;
5590 my $openparens = $1;
5591 my $count = $openparens =~ tr@\(@\(@;
5592 my $msg = "";
5594 my $comp = $4; #Not $1 because of $LvalOrFunc
5607 my $lead = $1;
5608 my $const = $2;
5609 my $comp = $3;
5610 my $to = $4;
5611 my $newcomp = $comp;
5632 my $name = $1;
5655 my ($stat_next) = ctx_statement_block($line_nr_next,
5663 my ($whitespace) =
5665 my $offset =
5675 my ($s, $c) = ($stat, $cond);
5676 my $fixed_assign_in_if = 0;
5683 my $space = $1;
5684 my $not = $2;
5685 my $statement = $3;
5686 my $assigned = $4;
5687 my $test = $8;
5688 my $against = $9;
5689 my $brace = $15;
5692 my $newline = "${space}if (";
5715 my @newlines = ($c =~ /\n/gs);
5716 my $cond_lines = 1 + $#newlines;
5717 my $stat_real = '';
5731 my $indent = $1;
5732 my $test = $2;
5733 my $rest = rtrim($4);
5760 my $s = $1;
5793 my $fixedline = $prevrawline;
5806 my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0);
5819 my $fixedline = $prevrawline;
5820 my $trailing = $rawline;
5831 my $var = $1;
5850 my $word = $1;
5880 my $file = "$1.h";
5881 my $checkfile = "include/linux/$file";
5886 my $asminclude = `grep -Ec "#include\\s+<asm/$file>" $root/$checkfile`;
5904 my $ln = $linenr;
5905 my $cnt = $realcnt;
5906 my ($off, $dstat, $dcond, $rest);
5907 my $ctx = '';
5908 my $has_flow_statement = 0;
5909 my $has_arg_concat = 0;
5920 my $define_args = $1;
5921 my $define_stmt = $dstat;
5922 my @def_args = ();
5952 my $exceptions = qr{
5968 my $stmt_cnt = statement_rawlines($ctx);
5969 my $herectx = get_stat_here($linenr, $stmt_cnt, $here);
6002 my @stmt_array = split('\n', $define_stmt);
6003 my $first = 1;
6005 foreach my $l (@stmt_array) {
6019 foreach my $arg (@def_args) {
6022 my $tmp_stmt = $define_stmt;
6026 my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g;
6049 my $cnt = statement_rawlines($ctx);
6050 my $herectx = get_stat_here($linenr, $cnt, $here);
6077 my $ln = $linenr;
6078 my $cnt = $realcnt;
6079 my ($off, $dstat, $dcond, $rest);
6080 my $ctx = '';
6089 my $stmts = $2;
6090 my $semis = $3;
6093 my $cnt = statement_rawlines($ctx);
6094 my $herectx = get_stat_here($linenr, $cnt, $here);
6107 my $cnt = statement_rawlines($ctx);
6108 my $herectx = get_stat_here($linenr, $cnt, $here);
6117 my ($level, $endln, @chunks) =
6122 my @allowed = ();
6123 my $allow = 0;
6124 my $seen = 0;
6125 my $herectx = $here . "\n";
6126 my $ln = $linenr - 1;
6127 for my $chunk (@chunks) {
6128 my ($cond, $block) = @{$chunk};
6131 my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s);
6132 my $offset = statement_rawlines($whitespace) - 1;
6163 my $sum_allowed = 0;
6180 my $allowed = 0;
6188 my ($level, $endln, @chunks) =
6192 my ($cond, $block) = @{$chunks[0]};
6211 my ($cond, $block) = @{$chunks[1]};
6221 my $cnt = statement_rawlines($block);
6222 my $herectx = get_stat_here($linenr, $cnt, $here);
6252 my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
6270 my $extracted_string = get_quoted_string($line, $rawline);
6271 my $comma_close = "";
6278 my $fixedline = $prevrawline;
6337 my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]);
6350 my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]);
6357 my $show_L = 1; #don't show the same defect twice
6358 my $show_Z = 1;
6360 my $string = substr($rawline, $-[1], $+[1] - $-[1]);
6401 my $tested = quotemeta($1);
6402 my $expr = '\s*\(\s*' . $tested . '\s*\)\s*;';
6404 my $func = $1;
6408 my $do_fix = 1;
6409 my $leading_tabs = "";
6410 my $new_leading_tabs = "";
6437 my $testval = $2;
6438 my $testline = $lines[$linenr - 3];
6440 my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0);
6453 my $level = $1;
6471 my $lc = $stat =~ tr@\n@@;
6473 my $stat_real = get_stat_real($linenr, $lc);
6476 my $pspec = $1;
6477 my $h = $2;
6478 my $lineoff = substr($stat_real, 0, $-[1]) =~ tr@\n@@;
6482 my $nspec = $pspec;
6500 my $val = $1;
6501 my $equal = "!";
6513 my $attr = $1;
6515 my $ptr = $1;
6516 my $var = $2;
6531 my $attr = $1;
6533 my $attr_prefix = $1;
6534 my $attr_type = $2;
6545 my $attr = $1;
6549 my $lead = $fixed[$fixlinenr] =~
6571 my $constant_func = $1;
6572 my $func = $constant_func;
6583 my $delay = $1;
6636 my $which = $1;
6644 my $barriers = qr{
6649 my $barrier_stems = qr{
6657 my $all_barriers = qr{
6670 my $underscore_smp_barriers = qr{__smp_(?:$barrier_stems)}x;
6738 my $attr = $1;
6741 my %attr_list = (
6768 my $orig_attr = $1;
6769 my $params = '';
6771 my $curr_attr = $orig_attr;
6774 my $new = $attr_list{$curr_attr};
6784 my $remove = "\Q$orig_attr\E" . '\s*' . "\Q$params\E" . '(?:\s*,\s*)?';
6813 my $type = $1;
6816 my $kernel_type = 'u';
6830 my $cast = $1;
6831 my $const = $2;
6832 my $suffix = "";
6833 my $newconst = $const;
6871 my $fmt = get_quoted_string($line, $rawline);
6887 my $stat_real;
6889 my $lc = $stat =~ tr@\n@@;
6891 for (my $count = $linenr; $count <= $lc; $count++) {
6892 my $specifier;
6893 my $extension;
6894 my $qualifier;
6895 my $bad_specifier = "";
6896 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
6920 my $stat_real = get_stat_real($linenr, $lc);
6921 my $msg_level = \&WARN;
6922 my $ext_type = "Invalid";
6923 my $use = "";
6943 my $ms_addr = $2;
6944 my $ms_val = $7;
6945 my $ms_size = $12;
6981 # my $ms_val = $7;
7040 my $call = $1;
7041 my $cast1 = deparenthesize($2);
7042 my $arg1 = $3;
7043 my $cast2 = deparenthesize($7);
7044 my $arg2 = $8;
7045 my $cast;
7063 my $min = $1;
7064 my $max = $7;
7082 my $lc = $stat =~ tr@\n@@;
7084 my $stat_real = get_stat_real($linenr, $lc);
7093 my $lc = $stat =~ tr@\n@@;
7095 my $stat_real = get_stat_real($linenr, $lc);
7097 my $format = $6;
7098 my $count = $format =~ tr@%@%@;
7121 my $function_name = $1;
7122 my $paren_space = $2;
7124 my $s = $stat;
7142 my ($st_type, $st_name) = ($1, $2);
7144 for my $s (keys %maybe_linker_symbol) {
7165 my $args = trim($1);
7167 my $arg = trim($1);
7182 my $ok = 0;
7183 my $cnt = statement_rawlines($stat);
7184 my $herectx = $here . "\n";
7185 for (my $n = 0; $n < $cnt; $n++) {
7186 my $rl = raw_line($linenr, $n);
7200 my $name = $1;
7226 my $oldfunc = $3;
7227 my $a1 = $4;
7228 my $a2 = $10;
7229 my $newfunc = "kmalloc_array";
7233 my $r1 = $a1;
7234 my $r2 = $a2;
7241 my $cnt = statement_rawlines($stat);
7242 my $herectx = get_stat_here($linenr, $cnt, $here);
7279 my $ull = "";
7296 my $config = $1;
7305 my @fallthroughs = (
7315 foreach my $ft (@fallthroughs) {
7317 my $msg_level = \&WARN;
7330 my $cnt = statement_rawlines($stat);
7331 my $herectx = get_stat_here($linenr, $cnt, $here);
7360 my $lead = $1;
7361 my $arg = $2;
7362 my $test = $3;
7363 my $otype = $4;
7364 my $trail = $5;
7365 my $op = "!";
7369 my $type = lc($otype);
7411 my $deprecated_api = $1;
7412 my $new_api = $deprecated_apis{$deprecated_api};
7457 my $offset = $+[6] - 1;
7539 my $var = $1;
7540 my $perms = $2;
7541 my $show = $3;
7542 my $store = $4;
7543 my $octal_perms = perms_to_octal($perms);
7571 my $newshow = "$show";
7573 my $newstore = $store;
7575 my $rename = "";
7599 foreach my $entry (@mode_permission_funcs) {
7600 my $func = $entry->[0];
7601 my $arg_pos = $entry->[1];
7603 my $lc = $stat =~ tr@\n@@;
7605 my $stat_real = get_stat_real($linenr, $lc);
7607 my $skip_args = "";
7612 my $test = "\\b$func\\s*\\(${skip_args}($FuncArg(?:\\|\\s*$FuncArg)*)\\s*[,\\)]";
7614 my $val = $1;
7632 my $oval = $1;
7633 my $octal = perms_to_octal($oval);
7643 my $extracted_string = get_quoted_string($line, $rawline);
7644 my $valid_licenses = qr{
7714 my $sob_msg = "'From: $author' != 'Signed-off-by: $author_sob'";
7767 my $newfile = $filename;
7769 my $linecount = 0;
7770 my $f;
7776 foreach my $fixed_line (@fixed) {