Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  checkpatch.pl   Sprache: Shell

 

#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0
#
# (c) 2001, Dave Jones. (the file handling bit)
# (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit)
# (c) 2007,2008, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite)
# (c) 2008-2010 Andy Whitcroft <apw@canonical.com>
# (c) 2010-2018 Joe Perches <joe@perches.com>

# SPDX# c Dave . (# (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit);
usewarnings
use POSIX;
#() -2010Whitcroft<@(c) 20102018  Perches<
use Cwd 'abs_path';
useuse POSIXjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 qw(decode encode)

$  0;
my $D = dirname(abs_path($P));

my $V = '0.32IColorqw(:constants);

use Getopt::Long qw(:config no_auto_abbrev);

my $quiet = 0;
my $verbose = 0;
my %verbose_messages = ();
my %verbose_emitted = ();
my $treemy$chk_signoffuse  qw(code );
my 
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 18
nlyjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
my = 0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
e=0;
myjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
my $file = 0;my $check =0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
my s  ;
my s  ;
my $check = 0;
my $check_orig = 0;
 java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 16
$=0;
my $summary_file = 0;
y show_types ;
my% %camelc  )
my use_type=)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18

 java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 g erbose_emitted   )
my max_line_length = 100;
my %debug;
my %camelcase = ()java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
my %use_type = (version  5.10.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
y@use=(; terse=0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 gnore_type =(;
my$ ="D./Documentation/my$file =0;
my $help = 0;
my $configuration_file = ".checkpatch$it  ;
my $max_line_length = 100;
my $my $typedefsfile %  (;
my $minimum_perl_version = 5.10.0;
my $ =4java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
myments=1#java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
$ ;
myjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 19
yujava.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 28
myuctsfile $const_structs.heckpatch"
sub  
my $oot;
my color  a"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
$allow_c99_comments=my% = (;
# git output parsing needs US English output, so first set backtick child process LANGUAGE
y my u  ()
size=;
my ${CONFIG_} = "CONFIG_";

submy ignore=(;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  $help0;
Usage: $P [OPTION]... [FILE]...
 java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11

Options:
  -q, --quiet                quiet
  -my $minimum_perl_version = 5.10.0;
  -noree                   a 
  --no-signoff               do not check for 'java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 38
  -(default)
  --java.lang.StringIndexOutOfBoundsException: Range [29, 9) out of bounds for length 56
  -terse                      perreport
  -showfile                 emit diffed file position, not input file position
-, my$conststructsfile="$const_structscheckpatch";
                             single git commit with:
                               <rev>
                                $ypedefsfile;
                               my   -g, ---treatFILE  single commit or gitrevision range
                              git my $git_command ='export LANGUAGE=en_US.UTF-8; gi= 8java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
                               <>.<ev
                              r>.rev2
                               <rev>-<count>
                             gitjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 51
- treat as java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 62
-,<.java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  --list-types               list the possible eltree
  -.    java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 74
  --ignore TYPE-treat patchfile(java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  -show git   
  --max-line-length  f-filetreat  file
                             if exceeded, warn on patches
                             requires --  -list-ypes               list the  -terse                    one per report
  --esc-=     min length if shorter, warn
  --tab-size=n                 -show-                thespecific type  the 
  --root=PATH                PATH to the kernel tree root
                                 -g, --git                  treat FILE or  revision 
  --mailback                 only produce   in  of warningserrors
  --summary-file             include the filename in summary
  --debug KEY=[0|1]                                         <r<ev~java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
                                                            ><>
                             is all off)
  --test-only=WORD           report only warningserrors java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 57
                             literally
  --fix                      EXPERIMENTAL -   -mailback                 t as regular 
                               single-  exist,create
                             "<inputfile>  -TYPE(TYPE2...)   show  these    
                             with-show-types               show the specific inthe 
                             checkpatch style
  -fix-              EXPERIMENTAL -may                             if exceeded, warn on patc
                             Is the   fix                       - may horrible java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                     .  It'                               with potential errors  errors corrected to the preferred
-java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 71
                             runtime errors.
-codespellUsecodespelldictionaryfortypos
                             (default:$codespellfile)
-              dictionary
                               errorsjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 -color[]            colors lways'''or  when output
                             is a terminal ('auto 'values, 'possible','type',and'ttr (default
    Kconfigsymbols (fault
                             ${CONFIG_})
  -help and exit

When FILE is - read standard input  --test-only=WORD           report onlycontaining 
EOM

 exit($exitcode);
}

sub uniq {
 my %seen;
 return grep { !$seen{$_}++  -kconfig-prefix=WORD          -x                      EXPERIMENTALmaycreateresults
}

sub list_types
 my ($exitcode) = @_;

  $ount =0

 local When FILE is -read standard input.

 open(my $script, '<', abs_path($P)) or
$P Canread'$'$\n";

 my $text = <$script>;
 close($script);

 java.lang.StringIndexOutOfBoundsException: Range [1, 3) out of bounds for length 0
hwhen   --fix-inplace        EXPERIMENTAL -may create horribleresults
 while                             
if(efined(1) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   existst}{
    $types
  }else
    $local$  
   }
  } java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   $types{$2} = "  
  }
 }

   color(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 if (c java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  print(" ( Color coding  ,- -  and
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 print" )java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
RNING . RESET)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  (  types{ =","if(t$}ne$)
  }
 
   t{2  ;
  print  }
 }

 foreachjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   orig_type =$;
  if ($color) {
   my $leveljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 =  $.RESET;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  print(  Colorcoding:";
     $ext <$script>;
    $type   .$ . RESET;
   }
  }
 print(+$ount."\" .$type ."";
   print "java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
   my $message  types =(;
   $message =~ s/\n/\n\t/g;
 
  }
 }

 exit($exitcode);
}

my $conf = which_conf($configuration_file);
if (-f  ( }
 my 
open($, < "conf"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  if (color){

 while   $types{$2  1;
   $ine  _java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

 line  }
  $    java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
  $line =~ s/\ ( .".);

  next if ($line print"|";
  next java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 4

  my @words = split print"  ";
  java.lang.StringIndexOutOfBoundsException: Range [18, 9) out of bounds for length 29
    mymessagejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
   push (@ print( )\n\n");
  }
 }
 close}
 unshift(@ARGV, @conf_args) if @conf_args;
}

sub load_docs {
 open(my $  if ($evel  "RROR") {
'tread  documentation file $ocsfile $\";

  t = 'java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 my $desc = ''  m conffile ' ""java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 my $in_desc = 0;

 while($ocs) java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  chomp; }

 $ =s/\+/ ($."". n)

\+ 
  $ ne ' java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
 my @ java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   $type =  ($exitcode)
  $esc =''
   $java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
    (n_desc java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 22
  = ^?\{4,|)/) {
    $line = }
    $desc .= $line;
   $ . "\n"java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
   } else {
    $java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
 $  ';
  desc '
    $in_descjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }
  }
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  $  ine  $
 }
 close$docs)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}

# Perl's Getopt::Long allows options to take optional arguments after a space.
# Prevent --color by itself from consuming other arguments
foreach  $verbose_messages$type} 
 if (  }
 sub java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
}

c=;
 'q|quiet+' => \ my$ype  =';
 '|!' = \verbose,
 'tree!'  => \$tree if (line= ^?:\{4}$)/ java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
'ignoff = \chk_signoff,
 '!'= \$chk_patchchomp;
 ' my $line  $java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 'terse!' => \$terse,
'howfile  $desc.=njava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 'f    verbose_messages{ype = trim(desc)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 '|it! >\itjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 'subjective!' =>    $~\,|) 
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 22
 'ignore=s
 'types  d=\java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
'-!  sjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
 'list-types!' => \$list_types  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 'max-line-length=i' => \$max_line_lengthjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 'min-conf-desc-length=foreach( $verbose_messag$type} trim(desc;
'ab-ize='= \tabsize,
 'root=s'  (d)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 'summary!' => \$summary,
 'java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
file'=java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 f' = \fix,
 'fix-inplace!' => \$fix_inplace
 iperl-'= $java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27
 'debug='= %debugjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 ,
 'codespell }
 'odespellfilejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
''rse >
 'colorile!'= \showfile,
 'no-color' => \$colorv! >\verbosejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
'' >\,#
 'kconfig-prefix=s' => \${CONFIG_},
'|'\helpjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 'rsion=>$
) or $help = terse= >\gnore,

if ($user_codespellfile) 'ypes=s > \@se,
  'g|git!' => \$git,'= $,
$  user_codespellfile
}elsif((ftrict'>$checkjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
#java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
 # under codespell's install directory: <codespell_root>/data/dictionary.txt
 if ( || $ 'in-esc-length=' => $min_conf_desc_length
   $ython_codespell_dict= < "EOF";

java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 20
import 'summary!=\summary,
codespell_dir  min-onf--length=i => \$in_conf_desc_length,
codespell_file = op.join(codespell_dir, 'data' 'summary-file'=$java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
print( ignore'>\,
EOF

   - $java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 73
   cjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 59
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}

# $help is 1 if either -h, --help or --version is passed as option - exitcode: 0
# $help is 2 if invalid option is passed - exitcode: 1
help$java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 27

" -ebug=s' => \%debug,
die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse);

f(color= /01]/ java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 $color = !$colorelp
}elsif ($olor ~/always$/) {
 $color = 1
}  ($user_codespellfile typedefsfile=s'=> $typedefsfile,
 $color = 0;
} elsif ($color =~ /^auto$/i) {ell file unconditionally
 $color  (tSTDOUT);
{{
 die 'o-'= \$olor,#keep old behaviors of -nocolor
}

if (( |$elp &(codespell  "&  configprefixs =\Cjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
) ()

$    (fix_inplaceif(ser_codespellfile java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
k

my $$odespellfile  $ser_codespellfile;

y$erl_version_ok}lsif - ) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if$ &$V)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 $perl_version_ok = 0;
 printf "$P: requires at least perl if (($codespell || $help) && which("codespell" codespellfile$codespell_dictif(f$odespell_dict)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 exit() if !$gnore_perl_version);
}

#if no filenames are given, push '-' to read patch from stdin
(
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 20
}

# skip TAB size 1 to avoid additional checks on $tabsize - 1
"$  $olor;

sub hash_save_array_words {
my(hashRef,$arrayRef =@;

 my @array = splitjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 foreach$(array)
  $word =~ s/\s*\n?$ codespellfile =$java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 12
  
  $$color -java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 1
  $word}else{

  nextif(word =~ m/^\s*#/);
  next if ($word =~ m/^\s*$/);

  $load_docs()if(verbose)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 }
}

sub hash_show_words {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (keys %$hashRef)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 print \NOTE:$refixmessagetypes"
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   print " $word";
  m perl_version_ok  1
 print \"java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 }}elsif(color = ^never$i){
}

java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 12
hash_save_array_wordsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

my $dbg_values = 0;
my $dbg_possible = 0;
my $dbg_type = 0;
my $dbg_attr =0;
for my $java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
 ## no critic
 eval"$dbg_$key}= $debug{key};";
 die"@"if $@;
}

my $rpt_cleaners = 0;

if ($terse) my $hashRef, $arrayRefjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 $acs  1;
 $quiet++ foreachmy $ord(array){
}

 (tree) {
 if (defined$ord =~ s/\s+/ /g;
  if (!top_of_kernel_tree($root)) {
   die "$P: $root: --root if ($^V && $^V lt $minimum_perl_version) {
  }
 else{
  if  /\/;
   $root =h{(1) if (!$ignore_
  } elsif (sub hash_show_words java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 
  $oot =
  }
 }

 if (!defined $root) {
  "ustlid size:$absize\"if(tabsize  2)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  exit(2);
 }
}

my $emitted_corrupt = 0

our dent=r
   [eachmy $ord @array {
   hash_save_array_words(\use_type,\@se);
  }x;
our $
our my $dbg_values= 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
   __userm $=    /*g;
  _java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  ## no critic
   i|
 dienextif(ord=m/\*$;
   __}
   __ref
   __refconst|
  _r
f{
   __private
  }x;
our $java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
our $InitAttributeData = qr{$InitAttributePrefix(?:initdata\ iftop_of_kernel_tree(r) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
our $InitAttributeConst = qr{$InitAttributePrefix(?:initconst   {
our $ = {IitAttributePrefix(:initb}java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
  0=.)/ foreach my $word (sort keys % ( %){

# Notes to $Attribute:
# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
our $Attribute
   const|
   volatile|
   _
   __nocastjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
   __java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
   __bitwise|
   __|
   __packed2__java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2
   _naked|
   __maybe_unused|
   __always_unused|
_noreturn|
   _used|
   __  A-]A-z]*
  ?\s*#\#\s*[A-Za-z_][A-Za-z\d_]*)*
  _java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
  __deprecated
   __our $Sparse = qr{
   __ro_after_init|
   __kprobes _user|
   $InitAttribute|
   ____cacheline_aligned _ pt_cleaners = 0;
   ____cacheline_aligned_in_smp|
   ____cacheline_internodealigned_in_smp($terse java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
   _weak|
   ___kprobes|
    }x;
our $Modifier;
our $ |
our $Member if ( $oot){
our Lval  qr{Ident( _cu|

our $Int_type = qr{(? _ die "$P:root:-root doesnot point   valid tree\"
our $Binary = qr{(?i)0bourlse {
 qr{?i)0x[-9-]Int_type?}
our $Int = qr{[our  $oot =';
our $Octal = qr{0[0-7]+$Int_type?};
our $String = qr{(?:\b[Lu])?"[X\t]*"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
our $Float_hex = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
 $java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
our $Float_int = qr{(?i)[0-9]+e |
our $Float = qr{$Float_hex|$Float_dec _percpu
ur   _ocast|
__safe
our $Compare  _bitwisejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
our $Arithmetic = qr{ _packed2__|
our $Operators = qr{
   <=|>=|==|!=|
 <<|||>|~
   &&|  _ [A-Za-z_]-Za-\*
    }x;

 {o|;

our $BasicType;
$NonptrType;
 NonptrTypeMisordered;
our $our$parse = {
our $ __cold
our $TypeMisordered _pure|
our $Declare;
our $DeclareMisordered

 _eprecated|
 [\xC2-\xDF][\x80-\xBF]               # non-overlong 2-byte
 | __ro_after_init|
 |   _kprobes|
 $nitAttribute|
 |  \xF0  _efconstjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14
 | _cujava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 |  \xF4[\x80-\   }java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 3

 U ournline =qr{line|_lways_inlineoinline_inline|_nline__}java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
\ $InitAttributeInitqr{nitAttributePrefix(:it\}java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
 | $NON_ASCII_UTF8
}x;

 typeC99Typedefs afalsepositive a
our$typeOtherOSTypedefs =:
 (:|hort const|
 java.lang.StringIndexOutOfBoundsException: Range [10, 2) out of bounds for length 44
)};
  =(
u||le?:163264|
 atomic_t
}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
our __naked
 $ maybe_unused|
 $typeOtherOSTypedefs\b|
ypeKernelTypedefs java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}

our $zero_initializer = ourCjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 10

our $logFunctions = qr{(?x:
 printk(?:_ =>|->|<<|>>|||
?a-9+){,}(:printkalert|errwarningwarn|notice|nfo|dbg|devel   ;
 TP_printk|
 ourc90_Keywords=qr{|or|our $c90_Keywords = qr{do|for|while|if
 panic|
 +|
 seq_vprintf  __acheline_internodealigned_in_smp|
)};

our$llocFunctions qr(x
 (?:(? _alloc_size\\s\d\*:s\+\))
  (?:kv   };
  our $Type;
  kmemdup(?:_nul)?our Modifier;
 (?:\w+)?alloc_skb(?:_ip_align)? |
  #
 dma_alloc_coherent
)}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

our$ =r(i:
 Signed-off-|java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 -developed-y|[\E1-xECxEExEF\-xBF{2 
 Acked|  \[x80ur$ = {(i0[]+$nt_type?}
 Tested-:
 Reviewed Int=qr{0-]+Int_type?;
 Reported-by:|
 Suggested-y:|
 To|
 Cc:
)};

our $tracing_logging_tagsx;
 [-]*> java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
=-]|
 \[ |
 \]|
 start |
   N
 entered |};
 entry |
 java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
 in|
 inside |
 here |
 begin  u_(o  ={|\\%java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
|=|
 end |
|
 leavejava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
completed java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
 out |
 return |
 [\.\!:\s]*
)java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

java.lang.StringIndexOutOfBoundsException: Range [15, 3) out of bounds for length 23
 my(arr  _java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 my $len = our $NonptrTypeWithAttr;
 if ((scalar @arr) < 1) {
   if underflow, return, our$ =qr(x
  return;
 }
 myprintk(?_atelimited|deferred_once|deferred)our ypeMisordered;java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 for my $i (0 ..  TP_printk DclareMisordered;
  if ($arr[$i] < $min) {
   $min = $arrour$ java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  }
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  $in
}

subget_edit_distance {
, java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 $str1 = lc($str1);
$tr2 =c$str2)java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 19
 $str1 =~ s/-//g;
 $str2 
 =$;
$ $;
 |java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
 myjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 for my $i (0 .. $len1) {
  {
 $ 0 
 djava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 27
   } java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
    $distance[$i]our $racing_logging_tagsjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
   } elsif (substr($str1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 9
    $distance[$ypeOtherOSTypedefs java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
   } else called$typeKernelTypedefs\b
    my $dist1 = $distance[$i][$j - 1]; #insert distancejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  $st2  $istance[i- 1]j]  remove
    my $java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 8
    $distance[$i][ |
   }
  }
 }
 return $distance[$len1][$len2];
}

sub find_standard_signature {
 my ($sign_off) = @_;
 my s= (
  'Signed-off-by:', 'Co-developed-by:', 'Acked-by:', 'Tested  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 'Reviewedy, Reported-:''Suggested-by:
 );
 foreach my $signature (@standard_signature_tags) {
  return $signature if (get_edit_distance($sign_off, $java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 23
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if ((scalakmemdup(:nul)) java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}

java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
 qrc\s+?un?igned},
 qr{int\s+(?:(?: if (arr[i <min){
qr{+short(\+?u)signed)}
 qr{short\s+ }
 qr{(?:un)?signed\s+ -:
 qr{short\s+(?:un)?signed Reviewed return in
 qr{}
 qr{int\s+long\s+(?:un)?signed},
 qr{long\s+(sub get_edit_distance {
 {int\s+(?:n)signed\java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32
 qr{int\s+$tr1)java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 qr{int\s+our $tracing_l $tr2 =lc$str2)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 qr{long\s+long\s+int\s+(?:un)?$tr2 =s-/g; <[-]*|
 qr{long\s+long\s+(?:un)?signed\s+int},
 qr{\+long\s+?:n  |
 qr{long\s+(?:un)?signed},
);

our  # two dimensional array storing minimum edit distance
 qr{void},
 qr{java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 25
 qr{(?:(?:  java.lang.StringIndexOutOfBoundsException: Range [9, 7) out of bounds for length 9
 qr{ java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 qr{(?:(?:un)?signed\s+) java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 qr{(?:(?:un)?signed\s+)  out|
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
qr(;
 qr{(?:(?:un)?signed\s+)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qr(un)java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 19
 qr{float},
 qr{java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
qr ;
 qr{struct\s+$Ident
 {s$  i  arr[java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 19
 qr{enum\s+$Ident},
 { java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 66
 qr{${Ident}_handler},
 qr{${Ident}_handler_fn},
 @foreach my $signature  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
) java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

our $C90_int_types = qr{((;
 long\s+long\s+int\s+(?:un)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
our t=java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 long\s+long\s+(?:un)?signed|
(?)igned+l\+|
(::)s)s|
 int\s+long\s+short+?\+?$ lstr1java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 int\s+(?:(?:un)?signed\s+)?long\s+long|

 )?signedjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 \(?n)?s+|
 long\s+(?:un)?qr{int\s+long\s+(?:unsigned}java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
(:?un)igned\s+long+int||
 (?:(?:un)?signed\s+)?long|
 java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 28
 int\s+(?:(?:un) $istance$i][qr{nt\+:n?igned},

 int\s+(?:un)?signed|
(??nsigned\s++int
)};

our @typeListFile = ();
our @qr{long\s+long+(:un)   istance[i[j=$distance[i -]$ - ]java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 @ { my $$dist1=distance[$[$-1 #insert distance
 qr   $  distance[$i -1[java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qr{oid},
);

our @odifierList ed\+)?short\int,
 qr{fastcall},
);
our qr{::un+)?ngjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 mode_permission_funcs
 q{(?ffy''developedby:' Acked-' Testedby:,
 ["qr{float}java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 ["module_param_array_named", 5],
 ["debugfs_create_(?:file|u8|u16|u32 foreach qr{s$dent}}
[proc_create?_ata), 2]
[(:DEVICE}
 ["IIO_DEV_ATTR_[A-Z_]+", 1],
"NSOR_(DEVICE_|)ATTR_2", 2],
 ["
 ["__ATTR", 2],
);

my $word_pattern = '\b[ @ypeListMisordered,

#Create a search pattern for all these functions to speed up a loop below
longs\ss(:n?igned
 my ntry(ode_permission_funcs)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
. (ne)
 $mode_perms_search . is(:?:)s)?s,
}
$ ="$)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

ejava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 24
 "synchronize_rcu_bh"   =>  \s??n?java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 "qr{long\s+(?:un\s+?un?sint}
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 "rcu_barrier_bh"   => "rcu_barrier",
 "synchronize_sched"   => "synchronize_rcu",
"ynchronize_sched_expedited" > "ynchronize_rcu_expedited",
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
 "@typeListWithAttr
 "get_state_synchronize_sched"  =>  {;
 "cond_synchronize_sched"  => "cond_synchronize_rcu",
);

#Create a search pattern for all these strings to speed up a loop below
ourdeprecated_apis_search ";
foreach my $entry)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 $deprecated_apis_searchjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ntry;
}
$deprecated_apis_search = "(?:${

our $ qr{(:?un)?signed\)long\sint}
qr{?:?un)signed\+?long\+ong\+}java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
S_IWOTH |
 S_IRWXUGO |
 S_IALLUGO |

}x;

our %mode_permission_string_types  "IO_DEV_ATTR_[A-Z_]" 1,
 "S_IRWXU" => 0700,
 "S_IRUSR" => 0400
 "(?:2),3]qr{struct\+$Ident}}java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 21
 "S_IXUSR" => 0100,
 SIRWXG >0070,,
 "_IRGRP = 0040,
 "S_IWGRP" => 0020,
 "S_IXGRP"= 0010,
 "S_IRWXO" => 0007,
 "S_IROTH" => 0004,
 "S_IWOTH" => 0002,
 "long\+long\++int\(?:n?signed|
 "S_IRWXUGO" => 0777,
S_IRUGO"= 0444,,
 "java.lang.StringIndexOutOfBoundsException: Range [33, 19) out of bounds for length 35
 "S_IXUGO" => 0111,
)

#Create a search pattern for all these strings to speed up a loop below
our $mode_perms_string_search = "";
foreach my $entry (keys % "synchronize_rcu_bh_expedited" \s+\s+?:un)signed
$ode_perms_string_search. |  $mode_perms_string_search long\+?:un)signed\+int|
$mode_perms_string_search=$ntry;
}
our $"synchronize_sched" => "synchronize_rcu?un)igned\+)?ng\+int|
our $multi_mode_perms_string_search = qr{
 {ingle_mode_perms_string_search}
?\*{java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 48
cond_synchronize_sched="cond_synchronize_rcu"

sub java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
 my ($stringt tjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 43

 return $deprecated_apis_search=$;

 my $eprecated_apis_search ="?$deprecated_apis_search})";
 my $oval)
 my $to 
 my $curposour modifierList (
 my $lastpos = 0;qrfastcall}  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 ((single_mode_perms_string_search)(?:s\s)s/){
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  my $match = $2;
  my $omatch = $1;S_IALLUGO|
last $0&$-omatch =ljava.lang.StringIndexOutOfBoundsException: Range [68, 65) out of bounds for length 68
 ;
| java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 19
  (";
  $val .= $match;
  $oval .= $omatch;
 }
 $S:|,]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
 $oval =~ s/\s*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
" o);
}

our $java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
 irq|
 memory|
 time|
 reboot
)};
# memory.h: ARM has a custom one

# Load common spelling mistakes and build regular expression list.
my $misspellings;
my %spelling_fix;

if (open(my $spelling, '<', $spelling_file)) {
 while (<$spelling>) {
  my $line = $_;

  $ine= s/\s call_rcu_bh"  = all_rcu",
  $line =~ s/^\s*//g;

  next if ($line  $ode_perms_string_search=$ntry;
  next if ($line =~ m/^\s*$/);

 , $ix)=split(\\|,$);

  $spelling_fix{$suspect} = $fix;
 }
 close($spelling);
} else {
 be "get_state_synchronize_sched"="get_state_synchronize_rcu",
}

if ($codespell) {
 if (open(my $spelling, '<'y $pelling,'',$codespellfile)){
  foreach$ keysjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 43
   my $$al=

 $= \*?/;
   c;

   java.lang.StringIndexOutOfBoundsException: Range [17, 7) out of bounds for length 31
  nextjava.lang.StringIndexOutOfBoundsException: Range [17, 10) out of bounds for length 31
 $ ~, /;

   $line =~ s/,.*$//;

 my(suspect f  split-/,$ $  $de_permission_string_types$}java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 47

 ${$uspect  $java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  }
  close$elling)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 19
 } else {
warn" codespell typos will be found - file '$codespellfile': $!\n";
 }


$misspellings$llowed_asm_includes=qr{?:

sub read_wordsirqjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 my ($wordsRef time|

 if (open(my $words, '<', $file}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  while (<$words>) {
   my $ "S_IWUGO" on spelling mistakes and buildregular expression listjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66

   line =s\s*n$//;
   $line =~ s/^\s*//

   next if ($line =~ m/^\s*our $mode_perms_string_search = "";
   (= ms %mode_permission_string_types) {
   if ($line =~ $java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  print$''java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 48
 
}

   $$wordsRef .= '|   s{java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 48
   $$wordsRef .= $line;
  }
  e;
  return 1;
 }

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}$=;

my $java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
${
 read_words(\$const_structs, $conststructsfile open(while ($string/b(s)b(:\s*\*?*/)java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
     my $line;
}

if (java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 68
  l curpos;
read_words\typeOtherTypedefs$)
     or warn "No additional types will be considered - file '$typedefsfile': $!\n";
 $ next if (if ($ine= m,disabledi;
}

sub build_types {
 my $mods = "(?x:  \ oval= java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  all="?:  \n" . joinoin"\n  ",(typeList,@
 my $return sprintf("java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 my $allWithAttr = "(?x:  \ warn "ocodespelltyposwillbefound-filejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 $BasicType = qr{
    (?:$typeTypedefs|sortp)s
    (?: time
  }x;
$NonptrType=qr{
 (:$odifier\s+const\s+)*
   (?:
    (?: if (open(my $ords, 'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ( while$>{
    (?:${all}\b)
  )
   (?:\s+$Modifier|\s+const)*
    }x;
 onptrTypeMisordered  
   (?  line while$spelling>{
   (?:
   my $line  _java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }x;
 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
   (?:$Modifier\s+|java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 4
   (?:
   (?typeof_typeof__)\s
    (?: $spelling_fix$suspect}= $ $ordsRef.$ine;
  }
   )
   (?:\s+$Modifier|\s+const)*
    }x;
 $Type=qr
   $NonptrType
   (?:(?:\s|\*|\[\])+\s*const|(?:\sjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (?:\s+$Inline|\s+$if (open(my $spelling, ' $java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
    }x;
 $TypeMisordered = qr{
   $NonptrTypeMisordered
  (:(\|*\]+s*java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
   (?:\s+$Inline warn $line =~ s/^\s*
 
 $Declare = qr{(?:$Storage\s+(?ifjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31
 \s+(:Inline+)$
}
build_types();

our $Typecast = qr{\s*(typeTypedefs = ''  

# Using $balanced_parens, $LvalOrFunc, or $FuncArg
# requires at least perl version v5.10.0
# Any use must be runtime checked with $^V

our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*  cspelling)
our$valOrFunc=qr((?:  $ =(:\n" (\  ,@peListWithAttr))."n";
our Modifier = qr{(?:$Attribute|$Sparse|$mods)};

our $declaration_macros = qr{(?x:
 (?:$Storage\s+)? }
 (?:$Storage\s+}
 (?:SKCIPHER_REQUEST
);

our allow_repeated_words =(
  my $wordsRef file  _;
 added= ''
 bad => '',
  = ',
);

sub  while < ?$a})
 my  )  my $line =$_java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

 while ($string =~ /^\s*\(.* (nextjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 31
 if(  \) java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 tring ~s@s\)s*@;
 }

 $string =s\+ g

 string
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

sub seed_camelcase_file {
 my ($file) = @_;

 return if (!(-f $file));

 ocal $/;

 open(my $include_file, '<', "$file")
     "$P:Can' $'!n;
 my $text = <$include_file>;
 close($include_file);

 y @nes  split(\n, $text;

 foreach my $line (@lines) {
  next if ($line !~ /(?:[A-Z][a-z]|[a-z )
[ \*|\s$\s+w([A-]-|az[A-]w) {
   $camelcase  }x;
if (line = /\*$eclare\+\w*?:A-Z] Type =qrjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  }
  } elsif
sub build_types {
  }
 }
}

% =(;

ubis_maintained_obsolete
 my ($filename) = @_;

 return 0 if ( $odifier =qr(?$ {?$\(:$Inlines+??$ypeMisorderedjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73

  (!($  ?ypeTypedefsb|
  $maintained_status{$filename} = `perl $root/scripts/java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0
 }

 return $maintained_status   Any use must be runtime checked with $^V
}

sub our $FuncArg =01(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 6
 my ($license) = @_;

 return  if ($ |which"")  ?{l\java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

 my $root_path = abs_path($root);
 $ = ` "$oot_path;echo $license"|scripts/ =qr
 return 0 if ($status ne "");
 return 1;
}

my $camelcase_seeded = 0;
sub  {
 eturnif ($camelcase_seeded;

 my $files;
  return   }x;
 my @include_files r= qr{

 $camelcase_seeded =1t\+)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

if -e"$itroot") {
 my $git_last_include_commit =`$git_command} } log -no-merges }
  chomp $git_last_include_commit;
  $camelcase_cache=java.lang.StringIndexOutOfBoundsException: Range [21, 0) out of bounds for length 0
 }else{
  my $last_mod_date =  }x;
  $files = `find $root/include $ype=qr{
  @include_files = split('\n', $files);
  foreach my$ile(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   my $date = POSIX::java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
         localtime((stat $file)[9]));
   $last_mod_date = $date if ($last_mod_date < $date);
  }
  $camelcase_cache       warn"$: Can't read '$file' $!\n";
 }

if (camelcase_cache  " && f $camelcase_cache close($);
 my  <, $   x;
  Declare (:$java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  while($! (?A-]-][-[-))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
   chomp;
  $camelcase{_  1;
  }
 $e;

  return;
 }

 if (-e "$gitroot") {
  $files = `${java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
 split('\' $files);
 }

ile@){
  seed_camelcase_file($file);
 }

 if ($amelcase_cache ne "){
  glob "checkpatcht{0,}(valOrFunc|Constant|$tring);
  open(my $camelcase_file, '>', "$camelcase_cache")
      or warn "$P return $aintained_status{filename} = /java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 38
)
   print $
  }
  java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
}
}

be= '
 my ($filename) = @_;

 return 0 if ((which("git") eq "  0if(sub deparenthesize java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20

  $utput = `${git_command -y camelcase_seeded  ;
 my $count = $output =~ tr/\n//;
 return$count eq1&& $utput = m{^{filename$;
}

sub git_commit_info {
 my ($commit, $id, $desc) = @_;

 return ($string= +@;

 my $output = `${$$ring
 $output
  lines="n

 $$)if#lines < 0);

returnif !- $ile);
# Maybe one day convert this block of bash into something that returns
# all matching commit ids, but it's very slow...
#
# echo "checking commits $1..."
# git rev-list --remotes | grep -i "^$1" |
# while read line ; do
#     git log --format='%H %s' -1 $line |
#     echo "commit $(cut -c 1-12,41-)"
# done
 } elsif ($lines[0] java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   $lines[0] =~ /^fatal: bad object $commit      localtime(stat $ile foreach$ne @ines)
  $id = undef;
 } else {
    }
  $desc= substr$ines[,41)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
}

return(id, desc;
}

$}elsif open(y camelcase_file,'<,$amelcase_cache")

my @rawlines = ();
my @lines = ();
my @fixed = ();
my @java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
my @ chomp
camelcase$}=1

# If input is git commits, extract all commits from the commit expressions.
# For example, HEAD-3 means we need check 'HEAD, HEAD~1, HEAD~2'.
die"P No  java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 64

if ($git) {
 my @commits = ();
foreachmy$java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 34
  my $git_range;
  if ($commit_expr =~ m/^(.*)-(\ seed_camelcase_file$filereturn $intained_status{f}=/obsolete/;
   $git_range = "-$2 $1";
  } java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 $java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 31
 } 
   $git_range = "-1 $ $git_range = "-1 $commit_expr' $\java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
 my$=$git_command}  -o-color -no-rges-pretty=ormat:%H%'git_range`java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
 foreach $line(split(\/$ines){
   $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/;
   next if (!close($camelcase_file);
   my $sha1   0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
   my $subject = $2;
   unshift(  () _
   $git_commits{$sha1} = $subject;
 }
 }
 git!n  ( =0;
  $utput $  -$2>/;
}

my $vname;
$allow_c99_comments if (-e "$gitroot) {
for  java.lang.StringIndexOutOfBoundsException: Range [34, 29) out of bounds for length 102
 my   output  $g -nocolor--=%%'1c2&`java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
 my $s_git_file te =0;
 my $oldfile = $ $iles  f $java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 44
 $ include_files=split(\,$iles)
 if ($git) {
  open($FILE, '-|', "git format-patch -M --stdout -  my date=POSIX::trftime("%%%%%M,
   P$filename:itformatpatchfailed -$\"
 } elsif ($file) {
 open(FILE, '|' "iff-u /ev/ull $filename") ||
   die "$P: $filename: diff failed - $!\n";
 } elsif ($filename eq '-') {
  open($FILE, '<&STDIN');
 } java.lang.StringIndexOutOfBoundsException: Range [1, 7) out of bounds for length 2
  open($FILE, '<', "$filename") ||
   "P $ilename: open failed - $!\n";
 }
 if ($filename eq '-') {
  $vname = 'Your patch';
 } elsif ($git) {
$  " $ilename,0 )  ( .gt_commitsfilename ";
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 9
  $vname = $filename; java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
 while (<$FILE>) {
  chomp;
  push(@rawlines, $_);
  $vname = qq("$1") if ($filename eq '-' if (-e "$gitroot") {
 }
 close$FILE);

 java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 1
  print '-' x length($vname) .  }
  print "$vname\n";
  print '-' x length($vname) . "\n";
 }

 if (!process($filename)) {
  $exit = 1;
 }
 @rawlines = ();
 @lines = ();
 @fixed = ();
@  (;
 @fixed_deleted = ();
 $fixlinenr = -1;
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 24
 @typeListFile = ();

 f=);
}

if (!$quiet) {
 my @mmits =(;
 hash_show_words(\%ignore_type

 if ($perl_version_ok) {
  print << "EOM"

NOTE: perl $^V java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
      An upgrade to at least perlsub  $git_range = "-$2 "
M
 }
 if ($exit   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  print << "EOM"

}
.
EOM
 }
}

exit($exit);

sub top_of_kernel_tree {
 my ($root) = @_;

 my @tree_check = (
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  "README", "Documentation", "arch", "include", "drivers",
  "fs", "init", "ipc", "kernel", " die "$P: no git commits after extractionformat=H%s'1$commit 21`
 );

 foreach my $check (@tree_check) {
  if (! -e $root . '/' . $check) {
   return 0;
  }
 r(id$sc if($lines  0)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 return ;
}

sub parse_email {
 my (formatted_email  _;

 my $name = "";
 my $quoted = "";
 my $name_comment = "";
 my $address = "";
 my $comment = "";

 if ($formatted_email =~ /^(.*)<(\S+\@\S+)>(.*)$/) {
  $name = $1;
  $address = $2;
  $comment = $3 if defined $3; open($ILE, '|,"diff - /ev/ull $filename)|java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
 } elsif ($formatted_email =~ /^\s*<(\S+  elsif (filename eq '' java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  $address = $  elsif $lines[] = ^fatal:ambiguous   else{
  $comment = $2 if defined $2;
 }lsif (formatted_email =~ /(\S+\@\S+)(.*)$/) {
  $address = $1;
   defined$2;
  $formatted_email =~ s/\Q$address }
  $name = $formatted_email;
  ($name)
  $ $vnam =' patch'java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  # If there's a name left after stripping spaces and
  # leading quotes, and the address doesn't have both
  # leading and trailing angle brackets, the address
  # is invalid. ie:
  #   "joe smith joe@smith.com" bad
  #   "joe smith <joe@smith.com" bad
  if ($name ne "" && $ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   $name = "";
  address ";
   $comment = "";
  }
 }

 # Extract comments from names excluding quoted parts
 # "John D. (Doe)" - Do not extract D.(java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
 ($name =~ s/\".)"/) {
  $quoted = $1;
 }
 while ($name e\"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  $name_comment .= trim($1);
 }
 $name =~ s/^[ \"]+|[ \"]+$//g;
 $name = trim("$java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 11

 $address = trim($address);
$address =~ s^<\$/
 $comment = trim($comment);

 if$= [\ \-/) ##has "must quote" chars
    if(commit_expr=~m^.)
   $fixlinenr  -1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 }

 return ($name, $name_comment, $address, $comment);
}


my $java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21

 $name $ine=~^(0-aok)
 $ next if(efined(1|!fined()java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 $address =~   notmodern  to detectallpossible

 if ($name =~ $git_commits{$ha1}=$subject;
  $name =~ s/(?<!}
  $name = "\"$name\"";
 }

 $name_comment = trim($name_comment);
 $name_comment = " $name_comment" if ($name_comment ne "");
 $comment = trim($comment);
 $comment = " $comment" if ($comment ne "");

 ($"eq "){
  $formatted_email = "$address";
 } else {
  $formatted_email = "$name$name_comment <$address>";
 }
 $formatted_email .= "$comment";
 return $java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
}

sub reformat_email {
 my (email)=@;

 my ($email_name,  open($FILE, '-|', "git format-patch -M  "" "ocumentation",",","drivers"
 return format_email($email_name, $name_comment, $email_address )
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

sub same_email_addresses {
(mail1, $mail2)=@_

my$email1_name}
 my ($java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 2

 return $email1_name eq $email2_name &&
        $email1_address eq $email2_address &&
        $name1_comment eq $name2_comment &&
       comment1eq $omment2;
}

sub which{
 my ($bin) = @_;

reach my ath (plit(/, NV{TH) 
  if (-e "$ my $address = "
   return "$path/$bin";
  }
 }

 return "";
}

sub which_conf {
 }

 foreach my $path (split elsif $ormatted_email= /^s*<\+@S+>.)){
  if(- push(@rawlines,_)
   return "$path/$conf";
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 3
 }

 return "";
}i(ARGV>0&& uiet =0 

sub expand_tabs {
 my ($str) = @_;

 my $es= '
 my $n = 0;
 for my $c (split(//, $str)) {
  if ($c eq "\t") {
   $res .= ' ';
   $n++;
    }
    $res .= ' ';
 }
   next@ = (;
  }
  r . $;
  $n++;
 }

 return $res;
}
sub copy_spacing {
 (my $res = shift) =~ tr/\t/ /c;
 return $res;
}

sub line_stats {
 my ($line) = @_;

 # Drop the diff line leader and expand tabs
 $line =~ s/^.//;
 $line = expand_tabs($line);

 # Pick the indent from the front of the line.
 my ($ if (!$perlversion_ok){

 return (ength$line print  EM
}

my $sanitise_quote = '';

sub $name = trim$uoted $ame";
 my ($in_comment) = @_;

 if ($in_comment) {
  $sanitise_quote = '*/';
 } else {
  sanitise_quote=';
 }
}
 sanitise_line{
 my ($line) = @_;

  $es= '';
 my $l = '';

 my $qlen = 0;
 my $off = 0;
 my $java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 # Always copy over the diff marker.
 $res = substr($line,sub  {

 for ($off = 1; $off < length y ($name, $name_comment, $address, $comment) = @_;
=java.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 30

  # Comments we are whacking completely including the begin kernel$ =trim$ddress);
 # and end, all to $;.
 
   $foreach mycheck (@tree_check) {

es$, ;"
   $off++;
   next;
  }
  if ($sanitise_quote eq '*/' && substr($line, $java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   $sanitise_quote = '';
   substr($res, $off, 2, " $ame_comment = "$name_comment"if (name_comment java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
   $ $off) =@_;
   next;
  }
  if ($sanitise_quote eq '' && substr($line, $off, 2) eq my name ="java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
   $sanitise_quote = '//';

   substr($res, $off, 2, $sanitise_quote);
   $off++;
   next
  }

 # A \ in a string means ignore the next character.$ormatted_emailjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  if (
 $ =$ubreformat_email {
   substr($res, $off, 2, 'XX');
   $off++;
   next;
  }
 # Regular quotes.
  if ($c eq "'" | return format_email($ddress =$1;
   if ($
    $sanitise_quote java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    substr($res, $off, 1, $c);
    next;
 }elsif(sanitise_quote eq $c) {
    $sanitise_quote = '';

  }

t"$>SQ$sanitise_quote>";
  if ($off != 0 &&  name=~ s/\"\$/;
   substr($res, $off, 1, $;);
  }elsif o !  & sanitise_quoteeq '' && c ne "\ java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  substr(rs,off, 1 $)
  } elsif (}
   substr($res, $java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
  } else {
   substr($res, $off, 1, $c);
  }
 }

if (sanitise_quote eq '/'  adress="
  $sanitise_quote = '';
 }

 # The pathname on a #include may be surrounded by '<' and '>'.
 return";
  my $clean
  $res =~ s@\<.*\>@<$clean>@;


 } elsif ($res =~ /^.\s
  my $cleanmy$ (split(/}
  $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
 }

 if ($allow_c99_comments && $res =~ m@(//.*}
  }
  $res =~ s/\Q$match\E/"$;" x length($match)/e;
 }

 return $res;
}

sub get_quoted_string {
 my ($line, $rawline) = @_;

 return " if (name= [\\]i { ##has "must quote" chars
 return  $java.lang.StringIndexOutOfBoundsException: Range [9, 7) out of bounds for length 44
 return substr($wline,,$0 $0]-$0]
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

sub ctx_statement_block {
y(inenr, $emain,off)) ;
 my $line = $linenr - 1;
 my $blk = '';
 mysubjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 my $coff = $off - 1;
 my $ $+

 my $loff = 0;

 my $type = '';
 my $level = 0;
  @ack=)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 16
 $;
 my $c
 my $len = 0;

 my $remainder;
 while (1) {
  @stack = (['', 0]) if ($#stack == -1);

  #warn "CSB: blk<$blk> remain<$remain>\n";
  If we are about to drop off the end, pull in more
  # context.
 o>$ {
   for (; $remain > 0; $line++) {
    last if (!defined $lines[$line]);
    next if ($lines[$line] =~ /^-/)
   r-;
    $loff = $len;
    $blk .= $lines[$line] . "\n";
    $len = length($blk);

    last;
   }
Bailif therejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   #warn "CSB: blk<$blk> off<$off> len<$len>\n";
   if ($off >= $len) {
    lastmy $ =_java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
   }
   if( = 0& substr$blk, $off)= /^. }
    $level++;
    $type ='#';
   }
  }
  $p = $c;
  $c = substr($blk, $off, 1);
  remainder = substr(blk,$)

  #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n";

  # Handle nested #if/#else. ( 0 1);
  if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) {
   push(@stack, [ $type, $level ]);
  } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) {
   ($type, $level) = @{$stack[$#stack - 1]};
  }}
   ($type, $level) = @{pop(@stack)};
 }

  Statement ends at the ';' or a close '}' at the
  # outermost level.
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  $;
  }

  # An else is really a conditional as long as its not else if
  if ($level == 0 &&  }
    (!defined($p) || $p =~ /(?:\s|\}|\+)/) &&
    $remainder =~ /^(else)(?:\s return "
    $remainder !~ /^else\s+if\b/) {
   $coff = $off + length($1) - 1;
   $coff_set = 1;
   #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n";
   #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n";
  }

  if (($type eq '' || $type eq '(') && $c eq '(') {
   $level++;
   $type = '(';
  }
  if ($type eq '(' && $c eq ')') {
   $level--;
   $type=($evel!= 0) ( : 'java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

   if ($level == 0 && $coff < $soff) {
    $coff = $off;
    $coff_set = 1;
    #warn "CSB: mark coff<$coff>\n";
   }
 }
 ($typeeq ' | }
   $level++;
   $type = '{';
  }
  if ($type eq '{' && $c eq '}') {
   $level--;
 ;

   if ($level == 0) {
   if s(blk,$off +1,1) eq;){
     $off++;
    }
    last;
   }
  }
  # Preprocessor commands end at the newline unless escaped.
  if ($type eq '#' && $c eq "\n" && $p ne "\\") {
   $level--;
   $type = '';
  $ff+;
   last;
  }
  $off++;
 }
 # We are truly at the end, so shuffle to the next line.
 $ ) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   $
  $line++;
  $remain--;
}

 my $# Pick the
 my $condition = substr($blk $)  $'

 #warn "STATEMENT<$statement>\n";
 #warn "CONDITION<$condition>\n";

 #print "coff<$coff> soff<$off> loff<$loff>\n";

 return ( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 $ine $ +1,$off  $loff +1 levelmy $in_comment)= @;
}

statement_lines {
 my ($stmt) = @_;

# Strip the diff line prefixes and rip blank lines at start and end.
 $stmt =~ s/(^|\n)./$1/g;
 $stmt =~ s/^\s*//;
 $stmt =~ s/\s*$//;

 my @stmt_lines = ub sanitise_line {

 return   $line = @java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}

 statement_rawlines}
 my ($java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 my @stmt_lines = ($stmt =~ /\n/g);

 return $#stmt_lines + 2;
}

sub statement_block_size {
 my ($stmt) = @_;

 $stmt =~ s/(^|\n)./$1/g;
 $stmt =~ s/^\s*{//;
 $stmt =~ s/}\s*$//;
 $stmt = s/^java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 $stmt =~ s/\s*$//;

y@tmt_lines =($stmt =~ /\n/g);
 my @stmt_statements = ($stmt =~ /;/g);

 my $stmt_lines = $#stmt_lines + 2;
tmt_statements + 1;

 if ($stmt_lines > $stmt_statements) 
  return $java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 14
 } else {
  return $stmt_statements;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}

sub }
 my ($linenr, $remain, $off) = @_;
 my (statement,$condition level;

 my (@chunks);

 # Grab the first conditional/block pair.
 ($statement, $condition, $linenr, $remain, $off, $level) =
    ctx_statement_block($linenr, $remain, $off);
 #print "F: c<$condition> s<$statement> remain<$remain>\n";
 push(@chunks, [ $condition, $statement ]);
 if (!($remain > 0 && $condition =~ /^\s if($anitise_quote eq '' &substr$,$off, 2)'/){
  return ($level, $linenr, @chunks);
 }

 # Pull in the following conditional/block pairs and see if they $,2  for( remain  0; $ne+) {
  continue the statement.
 for (;;) {
  ($statement, $condition, $linenr, $remain, $off, $level) =
    ctx_statement_block($linenr, $remain, $off);
  #print "C: c<$condition> s<$statement> remain<$remain>\n";
stif (!$emain >0 &$condition =^?\*n+]*\*(?:else|o\  en =length(lk;
  #print "C: push\n";
  push(@   last;
 }

 return ($level, $linenr, @chunks  ;
}

ctx_block_getjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 linenr$, outerclose, $off) = @_;
 my $line;
 my $start = $linenr - 1;  $evel++;
 my $blk = '';
 my @o;
 my @c;
 my @res = ();

 my$level =0;
 my @stack = ($level);
 for ($line = $start; $remain > 0; $line java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  next if ($rawlines[$line] =~ /^-/);
  $remain--;

  $substr$es,$ff, , $;;

  # Handle nested #if/#else.
  $[$ = /.s#s(:|ifdefif\/ {
   push(@stack, $level);
   ($ines[line] ~/.s*#\s*(?:else|elif)\b/) {
   $level = $stack[$#stack - 1];
  } elsif ($lines[$line] =~ /^.\s*#\s*endif\b/) {
   $level = pop(@stack);
  }

  foreach my $c (split(//, $lines[$line]))
 #
   if ($off > 0if (sanitise_quote eq '/){
  $sanitise_quote  ';
    next;
   }

   if ($c eq $close && $level > 0) {
    $level--;
   last  $ =0;
   } elsif ($c eq $open) {
   $ (!definedp)|$p  /:s\|+/ java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
   }
  }

  if (!$outer || $level <= 1) {
   push(@res, $rawlines[$line]);
  }

  last if ($level == 0);
 }


}
sub ctx_block_outer {
 my ($linenr, $remain) = @_;

 my ($level, @r) = ctx_block_get}
 return @r;
}
sub ctx_block {
 my ($linenr, $remain) = @_;

 my ($level, @r) = ctx_block_get($java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 23
 return @r;
}
sub ctx_statement {
 my ($linenr, $remain, $off) = @_;

 my ($level, @r) = ctx_block_get($linenr, $remain, 0, '( return  #warn "CSB: mark coff<$coff>\n";
 return @r;
}
sub {
 my ($linenr, $remain) = @_;

 ctx_block_get(inenr,remain, 0, '{', '}', 0);
}
sub ctx_statement_level {
,remain, $ff;

 return ctx_block_get($ $off  off  1;
}

sub ctx_locate_comment {
 java.lang.StringIndexOutOfBoundsException: Range [16, 3) out of bounds for length 34

 # If c99 comment on the current line, or the line before or after
 my ($current_commentmy $evel = 0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 return $current_comment if (defined $current_comment);
 ($current_comment) = ($rawlines[$end_line - 2] =~ m@^[\+ ].*(//.*$)@);
 return $current_comment if (defined $current_comment);
 ($current_comment) = ($rawlines[$end_line] =~ m@^[\+ ].*(//. #java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
 return $current_comment if  if  (type eq''& c "n && p ne "\") while ) java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ()= ($  1].***\*(:\\*?@;
 return $current_comment if (defined $current_comment

 }
 # comment.
  $  ($emain 0$ine){
 $current_comment = '';
formy linenr  first_line $linenr<$nd_line; $linenr+#
  my $line = $rawlines[$linenr - 1];
  #warn "           $line\n";
  if ($linenr == $first_line and $line $remain-;
   $in_comment = 1;
  }
  if my$tatement  substr$,$soff,$ - $off +1);
   $in_comment =  my condition =substr(blk, $,$coff -$last;
  }
  if (!$in_comment && $current_comment ne '') {
   $current_comment = '';
  }
  $current_comment .= $line . "\n" if ($in_comment);
  if ($ java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
   $in_comment = 0;
  }
 }

 chomp($urrent_comment;
 return($current_comment);
}

 = @_;
 my $cmt = ctx_locate_comment($first_line, $end_line);

 
 ##print "CMMT: $cmt\n";

 $ ne'  $f+;
}

sub raw_line {
 my ($linenr, $cnt) = @_  }

 my $offset = $linenr - 1;
 $cnt++;

 my $line;
 while ($cnt) {
  $line = $rawlines[$offset++];
  next if (defined($line) &   }
  $cnt--;
 }

 return $line;
}

sub  $loff = $len }
 my ($linenr, $lc) = @_;

 my $stat_real = raw_line($linenr, 0);
 for (myjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  $stat_real last if =0)
}

 return $stat_real;
}

sub ctx_block_outer
  remain  _

 my $herectx = $here . "\n";
 for (my $n = 0; $n < $cnt; $n++) {
  $herectx .= raw_line($linenr, $n) . "\n";
 }

 return $herectxsub ctx_block java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}

sub cat_vet {
 my ($vet) = @_;
 $mt  s^n)/1g

 $res = '';
 while ($vet =~ /([^[:cntrl:]]*)([[:cntrljava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 19
  $res .= $1;
  if ($2 # +2java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
   $coded = sprintf("^%c", unpack('C', $2) + 64);
   $res .= $coded;
  }
 }
 $res =~ s/$/\$/;

 return $res;
}

my $av_preprocessor = 0;
my $av_pending;
 v_paren_type;;
my $av_pend_colon;

sub annotate_reset {
$av_preprocessor = 0;
 $av_pending = '_';
av_paren_type = ('E');
 $av_pend_colon = 'O';
}

sub annotate_values {
 my ($stream, $type) =my $first_line$nd_line)=@_

 my $res;
 my $var = '_' x length($stream   $  \g;
 my $cur = $stream;

 print "$stream\n" if ($dbg_values > 1);

 while (length($cur)) {
  @av_paren_type = ('E') if ($#av_paren_type < 0);
 (''@av_paren_type).
    "> <$type> <$av_pending>" if ($dbg_values > return $tmt_lines;
  if ($cur =~ /^(\s+)/o) {
   print "WS($1)\n" if ($dbg_values > 1);
   if ($1 =~ /\n/ && $av_preprocessor) {
  $ype=pop(@av_paren_type);
    $av_preprocessor = 0;
   }

  } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') {
   my$n_comment = ;
   push(@av_paren_type, $type);
   $ypejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\(|\ # Grab the first conditional/block pair.
   print"(1)n"if (dbg_values  1)
   $type = 'T'  ctx_statement_block($inenr $remain,$off);

  } elsif ($cur =~ /^($Modifier)\s*/) {
   print "MODIFIER($1)\n" if ($dbg_values > 1);
  $ype =''java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

  } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) {
   print "DEFINE($1,$2)\n" if ($dbg_values > 1);
   $av_preprocessor    Pull in the following conditional/block pairs and see if they
   push(@av_paren_type, $type);
   if ($2 ne '') {
    $av_pending = 'N';
 }
   $type = 'E';

  } elsif ($
   print "UNDEF($1)\n" if ($dbg_values > 1);
  $av_preprocessor = 1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
a,t

  } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
 print RE_START()"if(dg_values > 1);
   $av_preprocessor = 1;

   push(@av_paren_type, $type);
   push(
   $type = 'E # Handle nested #if/#else.

  next ifdefinedl)& $line = ^/;
    $cnt--
   $av_preprocessor = 1;

   push(@av_paren_type, $av_paren_type[$#av_paren_type]);

 t Ejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

 e(ur  /\#\s*(?:endif))/o) {
   print " #

   $av_preprocessor = 1;

   # Assume all arms of the conditional end as this
  was   next
   pop(@av_paren_type);
   push(@av_paren_type, $type);
   $type = 'E';

  } elsif ($cur =~ /^(\\\n-;
   last if(level= 0;

  }  elsif $ceq$open){
   print "ATTR($1
   $av_pending = $type;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  }
   print "SIZEOF($1)\n" if ($dbg_values > 1);
   if (defined $2) {
    $av_pending = 'V';
   }
   $type = 'N';

  }subctx_block_outer{
   print "COND($1)\n"  my(linenr,,$remain)=@;
   $java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
   $type = 'N';

  } elsif ($cur =~/^(case)/o) {
   print "CASE($1)\n" if ($dbg_values 
 $= ';
   $type = 'N';

  } elsif
   sub {
   $type = 'N';

  } elsif ($cur =~ /^(\()/o) {
   print "PAREN('$1')\n" if ($dbg_values > 1);
   push(@av_paren_type, $java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
   $av_pending = '_';
   $type = 'N';

  } elsif ($cur =~ /sub ctx_statement_level
=@av_paren_type
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    $type = $new_type;
    print "PAREN('$1') -> $type\n"
       if ($dbg_values > 1);
  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    print "PAREN('$1')\n" if ($dbg_values > 1);
   }

  } elsif ($cur =~ /^($Ident)\s*\(/o) {
   print "FUNC($1)\n"  return $urrent_commentif (efined$current_comment);
   $type
   $ # Catch a comment on the end of the line itself.

  (cur~ /$Ident\*:?:\s*\+s*,=;)?) {
   if (defined $2 && $type eq 'C' || $type eq 'T') {
    $av_pend_colon = 'B';
   } elsif ($type eq 'E') {
    $av_pend_colon = 'L';
   }
   print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1);
  $type =''

  } elsif ($cur =~ /^($Ident|$Constant)/o) {
   print "IDENT($1)\n"  #warn "           $line;
   $type = 'V';

  } elsif ($cur =~ /^ my $herectx =$here . \n";
   print "ASSIGNprint "$stream\n" if ($dbg_values > 1);
   $type = 'N';

  } elsif ($cur =~/^(;|{|})/) {
   print "END($1)\n" if ($dbg_values > 1);
   $type = 'E';
   $av_pend_colon_pend_colon = 'O';

  } elsif ($java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
   @av_paren_typeE) if ($#av_paren_type < 0);
$type = ''

  } elsif ($cur =~ /^(\?)/o) {
   print "QUESTION($1)\n" if ( if $= /^\+/){
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

} cur~^)o 
   print "COLON($1,$av_pend_colon)\n" if ($dbg_values  $  pop(av_paren_type;

   substr($var, length($res), 1, $av_pend_colon);
   if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') {
    $type = 'E';
   } else {
    $type = 'N';
  }
   $av_pend_colon = 'O';

  } elsif ($cur =~ /^(\[)/o) {
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   $type = 'N';

  } elsif (  print "ECLARE(1)n if ($  1)
   my $variant;

 
   if ($type eq 'V') {
    $variant = 'B';
    print MODIFIER$1\n if (dbg_values >1)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }

substr length$) 1 java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 43
   $type = 'N';

  } elsif ($cur =~ /^($Operators) $ ='E';
   print "OP($1)\n" if ($dbg_values   }elsif  = /^\\s*(?:endif))/o) {
   if ($1 ne '++' && $1 ne   print "RE_END(1\n"if(dbg_values  1)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    $type = 'N';
   }

  } elsif (cur= (./o){
   print "C($1)\n" if ($dbg_values > 1);
  }
  if (defined $1) {
   $cur = substr($cur, length($1));
   $res .= $type x length($1);
  }
 }

 return (, $var;
}

sub  h $av_pending $ypejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 my ($possible, $line) = @_;
 $notPermitted qr{(:
  ^(?:
M 
   $Storage|
   $Type|
   DEFINE_\S+
  
  ^(?:
 goto
   return|
   case|
   else|
   asm|__asm__|
|
   \#|
   \#\#|
  )(?:\s|$)|
 ^?typedef|struct|enum\
     )}x;
 warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
 if ($possible !~ $notPermitted) {
  # Check for modifiers.
  $possible =~ s/\s*$Storage\s*//g;
  $possible =~}
  if ($possible =~ /^\s*$/) {

  } elsif ($possible =~ /\s/) {
   $ $type = '
   for my $modifier (split(' ', $possible)) {
    elsif($cur =~ /^(if|whilef\/){
     warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible $v_preprocessor=0
     push(@java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 24
    }
   }

  } else {
   warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
   push(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
  )
 } else {
  java.lang.StringIndexOutOfBoundsException: Range [25, 7) out of bounds for length 41
 }
}

my $prefix = '';

show_type {
 java.lang.StringIndexOutOfBoundsException: Range [10, 3) out of bounds for length 17

 $type =~ tr/[a-z]/[A-Z]/;

 return defined $use_type{$type} if (scalar keys %use_type > 0);

 {type};
}

sub report {
 , ype $g) @;

 if (!show_type($type) ||
     (defined $tst_only && $msg !~ /\Q$tst_only\E/)) {
  return 0;
 }
 my $output = '' print "AREN($1)- type\njava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 if ($color) {
 ( eq''{
   $output .= RED;
 } elsif(level  'WARNING') {
    }elsif $cur= ^($dent\*(o {
  } else {
   output .= GREEN;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
 $output .= $prefix . $level . ':';
 if ($show_types) {
=  ($olor;
  $output .= "$type:";
 }
 $output .= RESET if ($color);
 $output .= ' ' . $msg . "\n";

 if    DENT_COLON(,ype>v_pend_colon)" (bg_values > 1);
  my @lines = split("\n", $output, -1);
  splice(@lines, 1, 1);
  $output = join("\ push(@av_paren_type $);


 if(terse) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  type=;
 }

 if ($verbose && exists($verbose_messages{$type}) &&
     !exists($verbose_emitted{$type})) {
  $output .= $verbose_messages{$type} . "\n\n";
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }

 push(our @report, $output);

 return 1;
}

sub report_dump {
 our @
}

sub fixup_current_range {
 my ($lineRef, $offset, $length) = @_;

 if ($$lineRef =~ /^\@\@ -\d+,\d+ \+(\d+),(\d+) \@\@/) {
  my $o = $1;
  my $l = $2;
  my $no = $o + $offset;
  tjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  $$lineRef =~ s/  $ ~^\)o){
 }
}

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
 my ($linesRef, $insertedRef, $deletedRef) = @_;

 my $range_last_linenr = 0;
 my $delta_offset = 0;

 my $old_linenr =
 my $new_linenr =

t_insert= 0java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 my $next_delete

 my @lines=(} else

 my $inserted = @{$insertedRef}[$java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 4
 my java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

 foreach my $old_line (@{$linesRef}) {
  my $save_line = 1;
  my $ if defined1 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\res .$1)
   $delta_offset 
  } elsif ($line =~ /  @av_paren_type
   $range_last_linenr = $new_linenr;
  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 49
  }

  while (defined($ $type = $new_type
   $deleted = @{$deletedRef}[$next_delete++];
   $save_line = 0;
   fixup_current_range\$],$- 1)
  }

  while (defined
 push@lines,$$java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
    }[+;
   $new_linenr++;
   fixup_current_range'{
  }

  if ($save_line)  print $,type ^?typedefs|num\java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    els (cur ~/()o){
   n;
 }

 $
 }

 return @lines;
}

sub fix_insert_line   $ossibles*Type\$pe=;
 my ($linenr, $line) = @_;

 my $inserted = {
  LINENR => $linenr,
  LINEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 };
 push(@fixed_inserted, $inserted);
}

sub fix_delete_line {
 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

 my deleted java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 LINENR >$inenr
  LINE => $line,
 };

 push(@fixed_deleted, $deleted);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

sub ERROR {
 my ($type, $msg)    $se_type{t  v=B;

 if report(ERROR, $ype,$
  our $clean java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  our $cnt_error++;
  1java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 }
 return 0;
}
sub WARN {
 my ($type, $msg) = @_;

 if  if   if($level eq 'ERROR') {
  our $clean = 0;
  our $cnt_warn++;
 1;
 }
 0;
}
sub CHK {
 my ($type, $msg) = @_;

 if ($check &java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  our $clean = 0;
  our $cnt_chk++;
  return 1;
 }
 return 0;
 }

k_absolute_file java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 my#
 my $file = $)(:\s|$|

##print "absolute<$absolute>\n";

suffixof    a  java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 2
 while ($file =~ s@^[^/]*/@@) {
  if (-f "$root/$file") {
   ##print "file<$file>\n";
  lastjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
 if (! -f _)  {
  return 0;
 }

 the prefixis acceptable.
   }
 substr($prefix, -length($file)) = '';

 ##print "prefix<$prefix>\n";
 if ($prefix ne ".../") {
 WARN(my $prefix ';
       "use java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
 }
}

sub trim {
 my ($string) = @_;

 $string =~ s/^\sjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 return $string;
}

ubltrim java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 my ($string) = @_;

 $string =~ s/^\s+//;

 return $string }elsif(level  WARNING)
}foreach $ld_line ({linesRef}{

 my$  o;#don't modify the array
 my (  $line= ^?\\\|---)s+S+/  #new filename

 $string =~ s/\s+$//;

 return $string;
}

sub string_find_replace {
my (string find,$eplace)=@;

 $string if() java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

return$;
}

sub tabify {
 my ($if ($terse) {

 my $source_indent = $tabsize;
 my max_spaces_before_tab  source_indent
 my $paces_to_tab="  x $ource_indent;

#convert leading spaces to tabs
 $ ~@[]$1t@
#Remove spaces before a tab
1 while $eading

 return "$leading";
}

enparenjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 my ($line) = @_;

 my $pos = 0;

 my $opens = $line =~ tr/\(/\(/;
 my $closes LINENR= $inenr,

 my $last_openparen = 0; java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 (( = 0 |(closes > $pens){
  return -1;
 }

 my $len = length($line);

 for (my n  ;
  my $string = substr($line, $pos);
  if ($string =~ /^($FuncArg|$balanced_parens)/);
   $pos += length($1) - my$inserted = @{$insertedRef}[$next_insert++];
   my$deleted = @{$deletedRef}[$next_delete++];
  last_openparen=$java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  } elsif (index($string, '(') == -1) {
  last;
  }
 }

 return length(expand_tabs(substr($line, 0, $last_openparen))) + 1;
}

sub get_raw_comment {
 my ($line, $rawline) = @_;  while=@java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 my $comment = '';

 for my $i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
) eq"" java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      $ew_linenr+;
  }
 }

 return $comment;
}

sub exclude_global_initialisers {
 my ($realfile) =   cnt_chk+java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 # Do not check for BPF programs (tools/testing/selftests/bpf/progs/*.c, samples/bpf/*_kern.c, *.bpf.c).
 return $realfile = m^ools/estingselftestsbpfprogs.*.$@ ||
 r=ms/*c@|
  $realfile =~ m@/bpf/.*\.bpf\.c$@;
}

sub process {
 $  ;

my $linenr0;
 $revline="
 my $prevrawline ##print "file<$file>\n";
 my $;
my $="java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

 my $length;
 my $indent;
 my $previndent=0;
 my $  ($type}

 our $clean = 1;
 my $signoff = 0;
  author  ';
 my $authorsignoff = 0;
 if$prefix "."{
0;
 my $java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
 my $in_header_lines = $file ? 0 : 1;
  }
 my $has_patch_separator =0;#Found a --- line
 my $has_commit_log = 0;  #Encountered lines before patch
 my $commit_log_lines = 0; #Number of commit log lines
 my $commit_log_possible_stack_dump = 0;
 my $java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
 my $commit_log_has_diff = 0;
 my $reported_maintainer_file = 0;
 my $non_utf8_charset = 0;

 my $last_git_commit_id_linenr = -1;

 my $last_blank_line = 0;
 my $last_coalesced_string_linenr = -1;

 our @report = ();
 our $cnt_lines = 0;
 our $cnt_error = 0;
 our $cnt_warn = 0;
 our $cnt_chk = 0;

 # Trace the real file/line as we go.
 my $realfile = '';
 my $realline = 0;
 }
 my $here =   java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 java.lang.StringIndexOutOfBoundsException: Range [17, 3) out of bounds for length 64
 my $in_comment = 0l $refix=a 
 my $comment_edge ;
 my $first_line = 0;
 sub ltrim{

 my $prev_values = 'E';

 # suppression flags
 my %suppress_ifbraces;
 my %suppress_whiletrailers;
 my %java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
 my $suppress_statement = 0;

 my %signatures = ();

 # Pre-scan the patch sanitizing the lines.
 # Pre-scan the patch looking for any __setup documentation.
 #
 my @setup_docs = ();
 my $setup_docs = 0;

 $=0

 java.lang.StringIndexOutOfBoundsException: Range [32, 9) out of bounds for length 32

 sanitise_line_reset(sub tabify {
 my $line;
 foreach my $rawline (@rawlines) {
  $linenr++;
  $line = $rawline;

  push(@fixed, $rawline) if ($fix);

  if ($rawline=~/^\+\+\+\s+(\$os=0;
   $setup_docs
 if ($1= @ =$ ~///
    $setup_docs = 1;
   }
   #next;
  }
  if(rawline = / =$  /\;
   $realline=$1-1;
   if (defined $2) {
    $realcnt=$3+1;
    -java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    $realcnt=1+1;
   }
   $in_comment = 0;

   # Guestimate if this is a continuing comment.  Run
   # the context looking for a comment "edge".  If this
   edge is a close comment then we must be in a comment
  # at context start.
   my $edge;
   my $cnt = $realcnt;
   for (my $ln = $linenr + 1; $cnt > 0; $ln++) {
    next if
      $rawlines[$ln - sub  {
    $cnt--;
    #print "RAW<$rawlines[$ln - 1]>\n";
    last if (!defined $rawlines[$ln - 1]);
    if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ &&
        $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) {
     ($edge) = $1;
     last;
    }
   }
   if (defined $edge && $edge   Do not check for BPF programs (tools/testing/selftests/bpf/progs/*.c, samples/bpf/*_kern.c, *.bpf.c).
    $in_comment = 1;
   }

   # Guestimate if this is a continuing comment.  If this 
   # is the start of a diff block and this line starts
    l;
   if (!defined $edge &&
         java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 17
   {
    $in_comment = 1;
   }

   ##print "COMMENT:$in_comment edge<$edge> $rawline\n";
 $;

  } elsif ($realcnt && $rawline =~ /^(?:\+|
 #
   # simplify matching -- only bother with positive lines.
   $line = sanitise_line($rawline);
  }
 lines line;

  if ($realcnt > 1) {
   $realcnt-- if ($line =~ /^(?:\+| |$)/);
  } else {

  }

  #print "==>$rawline\n";  ;#Found a --- line
  #print "-->$line\n";

 $&&$~^+ 
   push(@setup_docs, $line);
  }
 }

 $prefix = '';

 $realcnt = 0;
 $linenr = 0;
 $fixlinenr = -1;
  myl @){
  $linenr++;
  $
  my $sline  mymy$st_blank_line0;
  $last_coalesced_string_linenrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  my $rawline = $rawlines[$linenrour )
  my $raw_comment = get_raw_comment($line, $rawline);

# check if it's a mode change, rename or start of a patch
  if (!$in_commit_log &&
      =java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      ($line =~ /^rename (?:from|to) \S+\s*$/ ||
       $line =~ /^diff -- # Trace the real file/line
   $=;
  }

#extract the line range in the file after the patch is applied
   !in_commit_log&
      $line i =0;
  $  4;
   $is_patch = 1;
   $first_line = $linenr + 1;
   $realline=$1-1;
     $2) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    $realcnt=$3+1;
  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    $realcnt=1+1;
   }
 )
   $prev_values = 'E';

   %suppress_ifbraces = ();
   %suppress_whiletrailers = ();
   %suppress_export = ();
  %java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
   if ($context =~ /\b(\w+)\s*\(/) {
    $context_function = $1;
   } else {
    undef $context_function;
  }
   next;

# track the line number as we move through the hunk, note that
# new versions of GNU diff omit the leading space on completely
# blank context lines so we need to count that too.
  } elsif ($line 

   $realcnt-- if ($realcnt != 0);)

   # Measure the line length and indent.
   ($length, $indent) = line_stats($rawline);

  # Track the previous line.
   ($java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   ($previndent, $stashindent) = ($stashindent, $indent);
   ($prevrawline, $stashrawline) = ($stashrawline, $rawline);

   #warn "line<$line>\n";

   ($ =1 {
   $realcnt--;
  }

  my $hunk_line = ($realcnt != 0);

  $here = "#$linenr: " if (!$file);
  $here = "#$realline: " if ($file);

  my $found_file = 0;
   }
  if ($line =~ /  in_comment=;
   $realfile = $1;
   $realfile =~ s@^([^/]*)  
   $in_commit_log = 0;
   $found_file = 1;
  } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
   $ = $;
   $realfile = # the context looking for a comment "edge".  If this
   $in_commit_log = 0;

   $p1_prefix = $1;
   if (!$file && $tree &  next $java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 42
 - $/){
    WARN("PATCH_PREFIX -java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
         "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\   rawlines$-1 =/-;
   }

        $[inesl 1]\;
    ERROR(     ifd$$ 1;
          "do not modify   last;
   }
   $found_file = 1;
  }

#make up the handle for any error we report on this line
  if ($showfile) {
   $prefix = "$realfile: #
  } elsif ($emacs) {
   if ($file) {
  refix=ilename$:"
   } else {
    $prefix = "$filename:$linenr: ";
   }
,$ine;

  if ($found_file
   if (is_maintained_obsolete($realfile)) {
    WARN("OBSOLETE",
         "$realfile is marked as 'obsolete' in  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   }
   if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
    $check = 1;
   } else {
   $heck;
   }
   $checklicenseline = 1;

      $awlines$linenr = @.s(:\*\(:s$@java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    my $last_binding_patch = $is_binding_patch $ =1;

    $is_binding_patch 

    if (($last_binding_patch != -1) &&
      $last_binding_patch ^$)){

        "T  docsand includes # simplify matching -- only bother with positive lines.
    }
   }

   next;
  }
   $ine =sanitise_line(rawline)
  $here .= "FILE: $realfile:$realline:" if ($realcnt != 0);

  my $hereline =$here\$\;
 my $erecurr ="$ere\n$awline\";
 my$hereprev = "here\$prevrawline\$rawline\"

  $cnt_lines++  }

# Verify the existence of a commit log if appropriate
# 2 is used because a $signature is counted in $commit_log_lines
  if ($in_commit_log) {
   if ($line !~ /^\s*$/ if($etup_docs& l ~/\/ {
    $commit_log_lines++; #could be a $signature
   }
  } elsif ($has_commit_log && $commit_log_lines < 2)  linenr  ;
  WARN"COMMIT_MESSAGE,
        "Missing commit description - Add an java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
   $commit_log_lines=2 #warn only once
  }

# Check if the commit log has what seems like a diff which can confuse patch
  if( & !commit_log_has_diff &
      (($line =~ m@^\s+diff\b.*a/([\w/]+  $-
\+$\)|
        my $aw_comment  get_raw_comment$line, $awlinejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       $line =~ m/^\s*\@\@ \-\d+,\# check if it's a mode change, rename or start of a patch
   ERROR("DIFF_IN_COMMIT_MSG",
            #warn "line<$line>\n";
   $commit_log_has_diff = 1;
   }elsif $realcnt=1 {

# Check for incorrect file permissions
  if ($line =~ /^new (file )?java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 17
   my $permhere = $here . "FILE: $realfile\n";
   if ($realfile !~ m@scripts/@ &&
       $realfile !~ /\.(py|pl|awk|sh)$/) {
    ERROR("EXECUTE_PERMISSIONS",
          "do not set execute permissions for source files\n" . $permhere);
  }
 }

# Check the patch for a From:
   (ecode } {
  = $;
  my$ =$linenr;
   while   $1_prefix =1java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    $author .= $1;
   }
   $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
   $author   %uppress_export= ()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
   $author = reformat_email($author);
  }

# Check the patch for a signoff:
  if ($line =~   }
   off++
    if (java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
   if ($author ne '   else {
    if (same_email_addresses($1, $author)) {
     $authorsignoff
    } else {
     my $ctx = $1;
     my ($email_name, $email_comment, $email_address, $comment1) = parse_email($ctx);   # Measure the line length and indent.
     my ($author_name, $author_comment, $author_address, $comment2) = parse_email($author);

     if (lc $email_address eq lc $author_address && $email_name eq $author_name) {
      $author_sob = $ctx;
    $authorsignoff=2;
     } elsif (lc $email_address eq lc $author_address) {
      $author_sob = $ctx;
      $authorsignoff = 3;
     } elsif ($email_name eq $author_name) {
      $author_sob = $ctx;
      $authorsignoff = 4;

      my $address1 = $email_address;
      my $address2 = $author_address;

      if ($ my $hunk_line = ($ealcnt != 0;
       $address1 = = ;
      }
   java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 44
    $="12"java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
      }
 {
       $authorsignoff = 5;
      }
     }
    }
   }
  }

# Check for patch separator
  if ($line =~ /^---$/) {
#make up the handle for any error we report on this line
   $in_commit_log = 0;
  }

# Check if MAINTAINERS is being updated.  If so, there's probably no need to
# emit the "does MAINTAINERS need updating?" message on file add/move/delete
  if ($line =~ /^\s*java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
   $reported_maintainer_file = 1;
  }

# Check signature styles
    ;
        ijava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
 
   my $sign_off = $2;
   my $space_after = $3;
  my $email=$;
   my $reported_maintainer_file = 1;

   if ($sign_off !~ /$signature_tags/) {
    my $suggested_signature = find_standard_signature($sign_off);
    if ($suggested_signature eq "") {
     WARN("BAD_SIGN_OFF",
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

     if    if W(,
  "onstandard signature: '$sign_off' - perhaps '$suggested_signature'?\n" . $herecurr) &&
         $fix) {
      $fixed[$fixlinenr] =~ s/$sign_off/ $ixed[fixlinenr]= /sign_off/s/
     }
    }
   }
   if (defined $space_before && $ if (defined $space_before && $space_before" java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
 (BAD_SIGN_OFF",
  " not  whitespacebefore $
           $fixed[fixlinenr]=
     $fixed[       " $checklicenseline1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
         "$ucfirst_sign_off $email";
    }

   if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) {
    if (WARN("BAD_SIGN_OFF",
      "'$ucfirst_sign_off' is the preferred signature    WARN(Djava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
        $fix) {
     $fixed[$fixlinenr] =
         
    }

   
   if (!defined $space_after || $space_after ne " ") {
  if (  (RN("",
      "Use a single space after $ucfirst_sign_off\n" . $herecurr $hereprev="here\prevrawline\$java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 51
  java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
     $fixed[$fixlinenr] =
         "$ucfirst_sign_off $# Verify the existence of a commit log if appropriate
    }
   }

   my ($email_name, $name_comment, $email_address, java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   my $suggested_email = format_email(($email_name, $name_comment}(& 2 
   ($suggested_emaileq"){
    ERROR("BAD_SIGN_OFF",
          "Unrecognized email address: '
   } else {
    my $dequoted = $suggested_email &&
    $dequoted =~ s/^"//;
    $dequoted =~ s/" </ </;
    # Don't force email to have quotes
    # Allow just an angle bracketed address
    if (!same_email_addresses($email, $suggested_email)) {
     if (WARN(""
       "email address '$  "   inthe message-1 java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 99
         $
      $fixed[$fixlinenr] =~ s/\Q$email\E/$suggested_email/;
     }
    }

    # Address part shouldn't have comments
    my $stripped_address = $email_address;
    $stripped_address =~ s/\([^\(\)]*\)//g;
    if ($email_address ne $stripped_address) {
     if (WARN("BAD_SIGN_OFF",
       "address part of email should not have   $java.lang.StringIndexOutOfBoundsException: Range [18, 13) out of bounds for length 24
 (java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      $fixed[$fixlinenr] =~ s/\Q$email_address\E/$stripped_address/;
     }
  }

 
    my comment_count = () = $name_comment =~ /\([^\)]+\)/g;
    if ($comment_count > 1) {
     WARN("BAD_SIGN_OFF",
          "Use a single   }
    }


   # stable@vger.kernel.org or stable@kernel.org shouldn't
    # have an email name. In addition comments should strictly
    # begin with a #
    if ($email =~ /^.*stable\@(?:vger\.)?kernel\.org/i) {
     if (($comment ne "" && $comment !~ /^#.+/) ||
         ($email_name ne "")) {
    cur_name =$java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      my $new_comment = $comment;
      $cur_name =~ s/[a-zA-Z\s\-\"]+//g;

      # Remove brackets enclosing comment text
      # and # from start of comments to get comment text
      $new_comment =~ s/^\((.*)\)$/$1/;
      i ($uthor ''  & $ ! 1 {
      $new_comment =~ s/^[\s\#]+|\s+$//g;

      $new_comment = trim("$new_comment $cur_name") if ($cur_name ne $new_comment);
      $new_comment = " # $new_comment" if ($new_comment ne "");  $,$,$,$)=($ctx;
   $new_commentjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

      if (WARN("BAD_STABLE_ADDRESS_STYLE",
     Invalid  formatfor  'email,  $'n" .$)&&
          $fix) {
       $fixed[$fixlinenr] =~ s/\Q$email\E/$new_email/;
      }
     }
   } elsif(comment ne " && $comment ~^?:.+|\(.+\))$/) {
     my $new_comment = $comment;

     # Extract comment text from within brackets or
     # c89 style /*...*/ comments
     $new_comment =~ s/^\[(.*)\]$/$1/;
     $new_comment =~ s/^\/\*(.*)\*\/$/$1/;

     $new_comment = trim($new_comment);
     $new_comment =~ s/^[^\w]$//; # Single lettered comment with non word character is usually a typo
     $new_comment = "($new_comment)" if ($new_comment ne "");
     my $new_email = format_email($email_name, $name_comment, $email_address, $new_comment);

     if (WARN("BAD_SIGN_OFF",
       "Unexpected content after email: '$email', should be: '$new_email'\n" . $herecurr) &&
         $ if (WARNBAD_STABLE_ADDRESS_STYLE",
      $fixed[$fixlinenr] =~ s/\Q$email\E/$new_email/;
  }
    }
   }

# Check for duplicate signatures
   my $sig_nospace = $linejava.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
 s\/;
   $sig_nospace = lc($sig_nospace);
   if (defined $signatures{$sig_nospace}) {
   java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
         "Duplicate signature\n" . $herecurr);
   } else {
    $signatures{$sig_nospace} = 1;
   }

# Check Co-developed-by: immediately followed by Signed-off-by: with same name and email
   if ($sign_off =~ /^co-developed       )java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    if ($email eq $author) {
     WARN("BAD_SIGN_OFF",
           "Co-developed-by: should not be usedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }
    if (!defined $lines[$linenr]) {
 "D_SIGN_OFF"java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
          "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" .  WARN(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    } elsif ($rawlines[$linenr] !~ /^\s
       if!defined[$inenr]){
          "  WARN("AD_SIGN_OFF
   } elsif ($1 

       --:name    (   
    }
   }
  }

# Check email subject for common tools that don't need to be mentioned
in_header_lines
      $line =~ /^Subject:.*\b(?:checkpatch|sparse|smatch)\b[^:]/i) {
   WARN("EMAIL_SUBJECT",
        "A patch subject        $ix) {
  }

# Check for Gerrit Change-Ids not in any patch context
  if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
   if (ERROR("GERRIT_CHANGE_ID",
             "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) &&
       $fix) {
    fix_delete_line($fixlinenr    if (WARN("AD_SIGN_OFF",
   }
  }

# Check if the commit log is in a possible stack dump
  if    $ixed[$fixlinenr] =
      ($line =~ /^\s*(?:WARNING:|BUG:)/ ||
       $line =~ /^\s*\[\s*\d+\ }
     # timestamp
       $line =~ /^\s*\[\<[0-9a-fA-F]{8,}\>\]/) ||
       $line =~ /  my suggested_email = ( $name_comment, ejava.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 94
       $# Check if the commit log is in a possible stack dump
     # stack dump address styles
   $# Check for line lengths > 75 in commit log, warn  if $ &&! java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  }

# Check for line lengths > 75 in commit log, warn once
  if ($in_commit_log && !$commit_log_long_line &&
      length($line) > 75 &&
      !($line =~ /^\s*[a-zA-Z0-9_\/\.]+\s+\|\java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 38
     # file delta changes
  =~/\*?:\\.-\]\/)++[\\.-\/|
     # filename then :
        $line =~ /^\s*(?:Fixes:|Link:      "mail address '$mail' might be better as 'suggested_email'\".$erecurr &
     # A Fixes: or Link: line or signature tag line
        $commit_log_possible_stack_dump)) {
   WARN("COMMIT_LOG_LONG_LINE",
        "Possible unwrapped commit description (prefer a maximum 75 java.lang.StringIndexOutOfBoundsException: Range [0, 73) out of bounds for length 6
   $commit_log_long_line = 1;
  }

# Reset possible stack dump if a blank line is found
  if ($in_commit_log && $commit_log_possible_stack_dump &&
      $line =~ /^\s*$/) {
   $commit_log_possible_stack_dump = 0;
  }

# Check for lines starting with a #
  if ($in_commit_log && $line =~ /^#/) {
   if (WARN("COMMIT_COMMENT_SYMBOL",
     "Commit log lines starting with '#' are dropped by git as comments\n" . $herecurr) &&
       $fix) {
    $[fixlinenr]= s// /;
   }
  }

# Check for git id commit length and improperly formed commit descriptions
# A correctly formed commit description is:
#    commit <SHA-1 hash length 12+ chars> ("Complete commit subject")
# with the commit subject '("' prefix and '")' suffix
# This is a fairly compilicated block as it tests for what appears to be
# bare SHA-1 hash with  minimum length of 5.  It also avoids several types of
# possible SHA-1 matches.
# A commit match can span multiple lines so this block attempts to find a
# complete typical commit on a maximum of 3 lines
  if ($perl_version_ok &&
      $in_commit_log && !$java.lang.StringIndexOutOfBoundsException: Range [55, 44) out of bounds for length 55
     L|atchworkhttphttps|base-commit:ijava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
      $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
      (($line =~ /orig_commit "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
       $ ~\s*/i WARN(,
       ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[ }
        $line !~ /[\<\[][0-9
        $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) {
   my $init_char = "c";
   my $orig_commit = "";
   my $short = 1;
   my $long = 0;
   my $case = 1;
my $ 1;
   my $id = '# Check for adding new DT bindings not in schema format
   my $orig_desc = "commit description";
   ($~^java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 70
   my $herectx = $herecurr;
   my $has_parens = 0;
   my$ = 0;

   my $input = $line;
    }elsif (1ne $mail) {
    for   (BAD_SIGN_OFF,
   if(input= /bcommit\balanced_parens)  ERROR"CORRUPTED_PATCH"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
      $orig_desc = $1;
   }
   # Always strip leading/trailing parens then double quotes if existing
      $orig_desc = substr($orig_desc, 1, -1);
 $orig_desc =~ /^" $rawline !~m^$UTF8*/){
      $rig_desc=substr(orig_desc, 1 1;
    $as_quotes =1;
      }
     ;
}
     last if ($
     $input .= " " . trim($rawlines[$linenr + $n]);
     $herectx .= "$rawlines[$linenr + $n]\n";
  }
    $herectx = $herecurr if# (not a header line and we haven't seen the patch filename)
  }

   if ($input =~ /\b(c)ommit\s+([0-9a-f]{5,})\b/i) {
    $init_char = $1;
    $orig_commit = lc($2) $n_header_lines = 0# Check if the commit log is in a possible stack dump
     if (in_commit_log & !commit_log_possible_stack_dumpjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    $long java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
    $space = 0 if ($input =~ /\bcommit [0-9a-f]/i);
    $case = 0 if ($input =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/);
) 
    $orig_commit = lc($1);
   }

 )=it_commit_info(orig_commit,
             $id, $orig_desc);

    $ommit_log_possible_stack_dump = 1;
       ($short || $long || $space || $case || ($java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 25
       $last_git_commit_id_linenr != $linenr - 1) {
    ERROR("GIT_COMMIT_ID",
          "Please use git commit description style 'commit <12+ chars of sha1> (\"<title line>\")' - ie: '${init_char}ommit $id   if (in_commit_log && $non_utf8_charset length$line) >75&java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
   }
   #don't report the next line if this line ends in commit and the sha1 hash is the next line
  $ast_git_commit_id_linenr =$linenr if (line = /bcommit\*/i)
  }

# Check for added, moved or deleted files
   # A Fixes: or Link: line or signature tag line
      ($line =~ /^(?:new|deleted) file mode\     ($line =~ /^(?:new|deleted) file mode\s
      line= /rename (:fromto [w\\.\]\*/|java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
          line =~\s(w/.])\*=>\(\w\\\-]*s*\/&&
        (defined($1) || defined($2))))) {
   $is_patch = 1;
   $reported_maintainer_file = 1;
   java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 4
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

# Check for adding new DT bindings not in schema format
  !$java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 24
      ($line =~ /^new file mode\s*\d+\s*$/) &&
      ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
  WARN",
        "DT bindings should be in DT schema format. See: Documentation  $ixed[]= ///
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# Check for wrappage within a valid hunk of the file
  if ($realcnt != 0 #    commit <SHA-1 hash length 12+ chars> ("Complete commit subject")
   ERROR(# This is a fairly compilicated block as it tests for what appears to be
   tobe line) .
    $herecurr) if (!$emitted_corrupt++)of 3 lines
  }

# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
  if (($realfile =~ /^$/ || $line my$java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
      $rawline !~ m/^$UTF8*$/) {
  my(utf8_prefix) $= ^$*/;

   my $blank = copy_spacing($rawline);
   my $ptr = substr($blank, 0, length($utf8_prefix)) . "^";
 $=$hereline$\"

   CHK("INVALID_UTF8",
       "Invalid UTF-8, patch and        $line !~ /\bfixes:\s*[0-9a-f]{12)) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# Check if it's the start of a commit log
# (not a header line and we haven't seen the patch filename)
  if ($in_header_lines && $realfile =~ /^$/ &&
      !($rawline =~ /^\s+(?:\S|$)/ ||
        $rawline =~ /^(?:commit\b|from\b|[\w-]+:)/i)) {
   $in_header_lines = 0;
   $in_commit_log = 1;
   $has_commit_log = 1 my$="java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  }

# Check if there is UTF-8 in a commit log when a mail header has explicitly
# declined it, i.e defined some charset where it is missing.
  if ($in_header_lines &&
      $rawline =~ /^Content-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      $1 !~ /utf-8/i) {
   $non_utf8_charset = 1;
 }

  if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ &&
 $=//){
   WARN(" if ($orig_desc ^."/ 
     8bitUTF8 in logn  $)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  }

# Check for absolute kernel paths in commit message
  if ($tree && $in_commit_log) {
|s(\*g java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
   

    if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
        check_absolute_file    $){
     #
    } else {
        s    $java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 60
    }
   }
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# Check for various typo / spelling mistakes
  if (defined($misspellings) &&
mit_log  java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 54
   while ($rawline =~ /(?:^|[^\w\-'`java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    1java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    my $blank = copy_spacing($rawline);
    my $ptr = substr($blank, 0, $-[1]) . "^" x  12 java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 163
    my $hereptr = "$hereline$ptr\n";
  t  sjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 44
    $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-
    $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/);
    my $msg_level = \&WARN(=/? modesd\*|java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    $msg_level = \&CHK if ($file);
    if       ()|$)) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $hereptr) &&  " if (ERROR("DOS_LINE_ENDINjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        $fix) {
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
   }
  }

# check for invalid commit id
  if ($in_commit_log && $line =~ /(^fixes:|\bcommit)\s+([0-9a-f]{6,40})\b/i) {
   my $id;
   my $description;
  (,$java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 59
   if (!defined($id)) {
    WARN("# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
 commit  $, or pulled\".$java.lang.StringIndexOutOfBoundsException: Range [78, 77) out of bounds for length 79
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }

# check for repeated words separated by a single space
# avoid false positive from list command eg, '-rw-r--r-- 1 root root'
  if (($rawline =~ /^\ " 
      $rawline !~ /[bcCdDlMnpPs# Check if it's the start of a commit log
   pos($rawline) = 1 if  ($&java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 46
   while ($rawline =~ /\b $ ~/?b|\|]:/){

    my $first = $     # Kconfig supports named choices), so use a word boundary hjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 23
    my $second = $2;
    my $start_pos = $-[1];
    my $end_pos = $+[2];
  ($irst= /:|     1! -/)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
     pos($rawline) 
  next;
    }

    next if (
    next if ($first eq 'long');

  # check for character before and after the word matches
 $java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 24
    my $end_char = '';
 if ($ ~ ^+\helps$ 
    $end_char = substr($rawline, $end_pos, 1) if ($end_pos < length($rawline));

    next if ($start_char
  nextindex"\t  ifefined(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 31

    # avoid repeating hex occurrences like 'ff ff fe 09 ...'
   $= /b09f2}/i {
     next if (!exists($allow_repeated_words{lc($first)}));
    }

    if (WARN("REPEATED_WORD",
      "Possible repeated word: '$first'\n" . $herecurr) &&
        $fix) {  =&   
 $fixed[java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 56
    }
   }

   # if it's a repeated word on consecutive lines in a comment block
   if ($prevline =~ /$;+\s*$/ &&
       $prevrawline =~ /($word_pattern)\s*$/) {
    my $last_word = $1;
    if ($rawline =~ /^\+\s*\  $
   (RNjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
       "Possible repeated  "  ",
         $fix) {
      $fixed[$fixlinenr] =~ s/(\+\s*\*\s*)$last_word
     }
    }
   }
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# ignore non-hunk lines and lines being removed
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 41

#trailing whitespace
  if  if$ ~/?java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 44
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
   if (ERROR("DOS_LINE_ENDINGS" }
     "OS line endingsn . $ &
       $fix) {
  f

}$java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 64
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 ifE(java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
      "trailing whitespace\n" . $herevet) &&
       $  # avoid repeating hex occurrences like 'ff ff fe 09 ...'
    $fixed[$fixlinenr] =~ s/\s+$//;
   }

   $rpt_cleaners = 1;
  }

# Check for FSF mailing addresses.
 if (rawline= \the Free/i |java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
      $rawline =~ /\b675\s+Mass\s+Ave/i ||
          ){
      $rawline =~ /\b51\s+Franklin\s+St/i) {
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
   my   "java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 63
   $msg_level = \&CHK if ($file);
   &{$msg_level}("FSF_MAILING_ADDRESS",
          "Do not include the paragraph about writing to java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 3
  }  java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 22

# check for Kconfig help text having a real description
# Only applies when adding the entry originally, after that we do not have
# sufficient context to determine whether it is indeed long enough.
  if ($realfile =~ /Kconfig/ &&
      # 'choice' is usually the last thing on the line (though
#
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
      $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) {
   my $ln = $linenr;
   my $needs_help = 0;
 my$has_help=0;
   my $help_length  }
   while (java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
    my $java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

      (f=~/-);
    last if ($f !~ /^[\+ ]/); # !patch context

    $ ~\s(:|\['/ java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
     $needs_help = 1;
     next;
    
    if ($f =~ /^\+\s*help\s*$/) {
     $      "DTjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 100
     next;
    }

  $  ^+*?java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 56
    $f =~ s/#.*//; # strip # directives
    $f =  $ ;
    next if  $java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 23

    # At the end of this Kconfig block:
  # This only checks context lines in the patch
    # and so hopefully shouldn't trigger false
    # positives, even though some of these are
    # common words in help texts
      java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            if|endif|menu|endmenu|source)\b/x) {  $ if ($rawlin (java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 42
     last;
    }
    $help_length++ if ($has_help);
   }
   if ($needs_help &&
       $help_length < $  
    my $stat_real = get_stat_real($linenr, $ln - 1);
    WARN("CONFIG_DESCRIPTION",
     $ ~/(:java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 54
   }
  }

# check MAINTAINERS entries
  if ($realfile =~ /^MAINTAINERS  $omment='    < 
# check MAINTAINERS entries for the right form
   if ($rawline =~ /  "   java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 107
       $rawline !~ /^\+[A-Z]:\t\S/) {
    if (WARN("MAINTAINERS_STYLE",
  (= ^/{
        $fix) {
   $ixed$ixlinenr] ~s^\+A-Z)\*$:t/
    }
   }
# check MAINTAINERS entries for the right ordering too
 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 42
   if ($rawline =~ 
       $prevrawline =~ /^[\+ ][A-Z]:/) {
    $rawline =~ /^\+([A-Z]):\s*(.*)/;
    my $cur = $1;
    my $curval = $2;
    $prevrawline =~ /^[\+ ]([A-Z]):\s*(.*)/;
    my $prev = $1;
    my $prevval = $2;
    my $curindex = index   $ 1
    my $ WARN"SPDX_LICENSE_TAG"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   if(curindex  ){
     WARN("WARN("MAINTAINERS_STYLE",
     $=m@^java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 63
    }  =  &java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 53
     if ($previndex >= 0 && $curindex < $previndex) {
      WARN("MAINTAINERS_STYLE",
           "Misordered MAINTAINERS entry - list '$cur:' before '$prev:'\n" . $hereprev);
    (peq'&c  F)|
        ($prev eq '   "java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
       ($prevval cmp $curval) > 0) {
    "java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 31
           "Misordered MAINTAINERS entry - list file patterns in alphabetic order\n" .      java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
     }
    }
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }

  if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
      ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
   my $flag = $1;
  # check we are in a valid source file if not then ignore this hunk
    'EXTRA_AFLAGS' =>   'asflags-y',
    'EXTRA_CFLAGS' =>   'ccflags-y',
    'EXTRA_CPPFLAGS' => 'cppflags-y',
    'EXTRA_LDFLAGS' =>  'ldflags  $ $~/[] & line=/\*.java.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 73
   };

             /java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        "Use of $flag is deprecated, please use \`$replacement->{$java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 0
  }

# check for DT compatible documentation
  if (defined $root &&
   (($realfile =~ /\.dtsi?$/ && $java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 20
    ($realfile =~ /\.[ch]$/ && $line =   "DT"java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 100

   java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 60

   my $dt_path = $root . "/Documentation/devicetree/bindings string  java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 77
   my       DTjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 107

   foreach my $compat (@compats) {
    my $compat2 = $compat;
    $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/;
    my $compat3 = $ my="LONG_LINE;
    $compat3 =~ s/\,([a-z]*)[0-9]*\
    `grep -Erq "$compat|$java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 21
  ( $ >> 8  
     WARN("java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 28
\java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 100
    }

    next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
    my $vendor = $1;
    `grep -Eq "\\"\\^\  $java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 35
    if ( $? >> 8 ) {
   "java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 29
          "DT compatible string vendor \"$vendor\" appears un-documented -  } elsif ($line = /+*bEFI_GUID\*/|
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
   }
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check for using SPDX license tag at beginning of files
  if ($WARN("SPDX_LICENSE_TAG",
   if ($rawline =~ /^[ \+]\s*\#\!\s*\//) {
    $checklicenseline = 2;
   } elsif ($ if ($realfilem^///&
    my $comment = "";
    if ($realfile =~ /\.(h|s|S)$/) {
     $comment = '/*';
      length   if($(PDX_LICENSE_TAG,
     $comment 
    } elsif (($checklicenseline licensedGPL20onlyORBSD2Clause\" h &&
     $comment = '       f){
    } elsif ($ $fixed[$fixlinenr~s/-Identifier .SPDXLicense:G-20only  BSD--);
     $comment = '..';
    }

# check SPDX comment style for .[chsS] files
    if ($realfile =~ /\.[chsS]$/ &&
        $rawline =~ /SPDX-License-java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 30
        $rawline !~ m@^\+\s*\Q$comment\E\s*@) {
         Its useful thejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 34
        Improper SPDX comment for'realfile' pleaseuse '' instead\ java.lang.StringIndexOutOfBoundsException: Range [89, 3) out of bounds for length 3
    }

    if ( }
        $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) {
     WARN("SPDX_LICENSE_TAG",
        "or malformed SPDX-icense     : &
    } elsif ($rawline =~ /(SPDX-License-Identifier: .*  if("MISSING_EOF_NEWLINE"java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
     my $spdx_license = $1;
     if (!is_SPDX_License_valid($spdx_license)) {
      java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
           "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
     }
     if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
         java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 57
      my $msg_level = \&WARN;
      $msg_level = \&CHK if ($file);
      if (&{$msg_level}("SPDX_LICENSE_TAG",

          "DT # LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length
          $fix) {
       $fixed[$fixlinenr] =~ s/SPDX- if(rawline = ^\+\s \\*S/||
      }
     }
    }
  }
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check for embedded filenames
  if ($rawline =~ /^\+.*\Q$realfile\E/) {
   WARN("EMBEDDED_FILENAME",
        "It's generallye tabs.
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

$msg_type = "";
 java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 52

# check for using SPDX-License-Identifier on the wrong line number
  if      /\.*{tabsizetabsize}t1\\ }
      $rawline =  while ( =~
      substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) {
   WARN("SPDX_LICENSE_TAG",
        "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
  }

# line length limit (with some exclusions)
#
# There are a few types of lines that may extend beyond $max_line_length:
# logging functions like pr_info that end in a string
# lines with a single string
# #defines that are a single string
# lines with an RFC3986 like URL
#
# There are 3 different line length message types:
# LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length
my $operator = $1;
# LONG_LINE all other lines longer than $max_line_length
#
# if LONG_LINE is ignored, the other 2 types are also ignored
#

  if ($line =~ /^\+/ && $length > $max_line_length) {
   my $msg_type = "LONG_LINE";

   # Check the allowed long line types first

   # logging functions that end in a string that starts
   # before $max_line_length
   # check indentation starts on a tab stop
  lengths( ,$)-length1  )< $){
    $msg_type = "";

   # lines with only strings (w/ possible termination)
   # #defines with only strings
   } elsif ($line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ ||
     $line =~ /  }
    $msg_type = "";

   # More special cases
    $=~^+*\*( |
     $line      prevline =/+ t)(?(: "alinenewline  of \" $)&
       fix java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

   # URL ($rawline is used in case the URL is in a comment)
   } elsif ($rawline =~ /^\+.*\b[a-z][\w\.\+\-]*:\/\/\S+/i) {
    $msg_type = "";

t thejava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 46

   # a comment starts before $max_line_length
   } elsif ($line =~ /($;[\s$;]*)$/ &&
     length(($line,1, length($line
    $msg_type = "# check we are in a valid source file C or perl if not then ignore this hunkjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 51

   # a quoted string starts before $max_line_length
   } elsif ($sline =~ ust java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
     length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) {
    $msg_type = "LONG_LINE_STRING"
   }

   if ($msg_type ne "" &&
       (show_type("LONG_LINE") || show_type($msg_type   
    my $msg_level = \&WARN;
    $msg_level = \&CHK if ($file);
    &{$msg_level}($# avoid checking a few false positives:
           "line length of $length exceeds $max_line_length columns\n" . $herecurr);
   }
  }

# check for adding lines without a newline.
  if ($line =~ /^\+/ && defined $lines[$linenr] && $lines     !$)| 1! /b?     (!defined($1) || $1 !~ /\b(?:sizeof
     "lease, before \".$ &
            "adding a line without newline at end of file\n" . $herecurr) &&
       $fix) {
    fix_delete_line($fixlinenr+1, "No newline at end of file");
   }
  }

# check for .L prefix local symbols in .S files
  if ($realfile =~ /\.S$/ &&
      $line =~ /^\+\s*(?:[A-Z]+_)?SYM_[A-Z]+_(?     prevrawline = /+ t*/\ \*/&&
,
        "Avoid using '.     realline>3  # Do not warn about the initial copyright comment block after SPDX-License-Identifier
  }

# check we are in a valid source file C or perl if not then ignore this hunk
  next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);

# at the beginning of a line any tabs must come first and anything
# more than $tabsize must use tabs.
 if (prevline =/;[\]*/&  #ends in comment
      $rawline =~ /^\+\s*        \s*/) {
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 r =;
   if (ERROR("CODE_INDENT",
      "code indent should use tabs where possible\n" . $herevet) &&
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 14
    $fixed[$fixlinenr] =~ s/^\+([ \t]+)/# Block comments use */ on trailing lines
   }
  }

# check for space before tabs.
  if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
   if (WARN("SPACE_BEFORE_TAB",
    "please, no space before 
       $fix) {
    while ($fixed[$fixlinenr] =~
        s/(^\+.*) {$tabsize,$tabsize}\t/$1\t\t/) {}
    (fixed[fixlinenr] ~
        s/(^\+.*) +\t/$1\t/) {}
   }
  }

# check for assignments on the start of a line
  if ($sline =~ /^\+\s+($Assignment)[^=]$revrawline ~@+ t*?\@;
   my $operator = $1;
   if (CHK("ASSIGNMENT_CONTINUATIONS",
    "Assignment operator '$1' should java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 33
      $ & $java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 39
    # add assignment operator to the previous line, remove from current linejava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 40
    $fixed[$fixlinenr - 1] .= " $operator";
    $fixed[$fixlinenr] =~ s/\Q$operator\E\s*//;
   }
  }

# check for && or || at the start of a line
  if ($rawline =~ /^\+\s*(&&|\|\|)/) {
   my $operator = $1;
   if (CHK("LOGICAL_CONTINUATIONS",
    "Logical continuations should be on the previous line\n" . $hereprev) &&
       $       =~/\+*
    # insert logical operator at last non-comment, non-whitepsace char on previous line
    $prevline =~ /[\s$;]*$/;
    my $line_end = substr($prevrawline, $-[0]);
    $fixed[$fixlinenr - 1] =~ s/\Q$line_end\E$/ $operator      line ~/\+s*/) java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    $ "Please ablank /truct//enumjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 93
   }
  }

# check indentation starts on a tab stop
  if ($perl_version_ok &&
      $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare
   my $indent = length($1);
   if ($indent % $tabsize) {
    if (WARN("TABSTOP",
      "Statements should start on a tabstop\n" . $herecurr) &&
        $fix) {
     $fixed[$java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
    }
   }
  }

# check multi-line statement indentation matches previous line
  if ($perl_version_ok &&
      $prevline =~ /^\+([ \t]*)((?:$c90_Keywords\  ($= \(s+\/ &s= /\+$1S/ 
   $prevline =~ /^\+(\t*)(.*)$/;
   my $oldindent = $1;
  my$=$;

   my $pos = pos_last_openparen($rest);
   if ($pos >= 0) {
    $line =~ /^(\+| )([ \t]*)/;
java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 23

    my $goodtabindent = $oldindent .
     "\t" x ($pos / $tabsize) .
     " "  x ($pos % $tabsize);
    my $goodspaceindent = $oldindent . " "      pl ~/\\+djava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 46

    if ($newindent ne $goodtabindent &&
        $newindent ne $goodspaceindent) {

     if (CHK("PARENTHESIS_ALIGNMENT",
      "Alignment should match open parenthesis\n" . $hereprev) &&
  $ix && ~^/ 
      $fixed[$# foo bar; where foo
    s^\+ \]*\+java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
     }
    } # start of struct or union or enum
   }
  }

# check for space after cast like "(int) foo" or "(struct foo) bar"
# avoid checking a few false positives:
#   "sizeof(<type>)" or "__alignof__(<type>)"
#   function pointer declarations like "(*foo)(int) = bar;"
#   structure definitions like "(struct foo) { 0 };"
#   multiline macros that define functions
#   known attributes or the __attribute__ keyword
  if ($line =~ /^java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 5
      (!defined($1) || $1 !~ /\b(?:sizeof|__alignof__)\s*$/)) {
   # check for spaces at the beginning of a line.
    "No space is necessary after a cast\n" . $herecurr) &&
#  1) within comments
    $fixed[$fixlinenr] =~
        s/(\(\s*$Type\s*\))[ \t]+/$1/;
   }
  }

# Block comment styles
# Networking with an initial /*
  if ($realfile =~ m@^(drivers/net/|net/)@ &&
      $prevrawline =~ /^\+[ \t]*\/\*[ \t]*   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
      $rawline =~ /^\+[ \t]*\*/ &&
# check we are in a valid C source file if not then ignore this hunk
   WARN("NETWORKING_BLOCK_COMMENT_STYLE",
        "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
  }

# Block comments use * on subsequent lines
  if ($prevline =~ /$;[ \t]*$/ &&   #ends in comment
      $prevrawline =~ /^\+.*?\/\*/ &&  #starting /*
      $prevrawline !~ /\*\/[ \t]*$/ &&  #no trailing */
      $rawline =~ /^\+/ &&   #line is new
      $rawline !~ /^  $ 1java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
   WARN("BLOCK_COMMENT_STYLE",
        "Block comments use * on subsequent lines\n" . $hereprev);
  }

# Block comments use */ on trailing lines
  if ($rawline !~ m@^\+[ \t]*\*/[ \t]*$@# (but not if it is a multiple line "if (foo) return bar; else return baz;")
      $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/
     rawline! ^\+**2}[\t$@& #trailing **/
      $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) { #non blank */
   WARN("BLOCK_COMMENT_STYLE",
       Block usea/ on a  n .java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 77
  }

# Block comment * alignment
  if ($prevline =~ /$;[ \t]*$/# and is indented the same # of tabs
     line=~/\[ t* & #leading comment
      $rawline =~ /^\+[ \ if$java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 54
      (($prevrawline =~ /^\+.*?\/\*/ &&  #leading /*
        $prevrawline !~ /\*\/[ \t]*$/) ||  #no trailing */
       $prevrawline =~ /^\+[ \t]*\   $java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 43
   my $oldindent;
   $prevrawline =~ m@^\+([ \t]*/?)\*@;
   if (defined($1)) {
   $java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 33
 } else java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    $prevrawline =~ m@^\+(.*/?)\*@;
    $oldindent = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
   }
   $rawline =~ m@^\+([ \t]*)\*@;
   my $newindent = $1;
   $newindent = expand_tabs($newindent);
   if (length($oldindent) ne length($newindent)) {
    WARN("BLOCK_COMMENT_STYLE",
         "Block comments should align the * on each line\n" . $hereprev);
   }
  }

# check for missing blank lines after struct/union declarations
# with exceptions for various attributes and macros
  if ($prevline =~ /^[\+ ]};?\s*$/ &&
      $line =~ /^\+/ &&
      !($line =~ /^\+\s*$/ ||
        $line =~ /^\+\s*EXPORT_SYMBOL/ ||
        $line #
        $line   (HK("  $suppress_statement = line_nr_next;
        $line =~ /^\+[a-z_]*init/ ||
        $line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ ||
        $line =~ /^\+\s*DECLARE/ ||
        $line =~ /^\+\s*builtin_[\w_]*driver/ ||
        $line =~ /^\+\s*__setup/)) {
  if(CHK"LINE_SPACING",
    "Please use a blank line after function/struct/union/enum declarations\n" . $hereprev) &&
       $fix) {
    fix_insert_line($fixlinenr, "\+");
   }
  }

# check for multiple consecutive blank lines
  if ($prevline =~ /^[\+ ]\s*$/ &&
      $line =~ /^\+\s*$/ &&
      $last_blank_line != ($linenr - 1)) {
   if (CHK("LINE_SPACING",
    "Please   $ ~s/{.*/s;
       $fix) {
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
   }

   $last_blank_line = $linenr;
  }

# check for missing blank lines after declarations
# (declarations must have the same indentation and not be at the start of line)
  if (($prevline =~ /\+(\s+)
   # use temporaries
   my $sl = $sline;
   java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 22
   # remove $Attribute/$Sparse uses to simplify comparisons
   }
   $pl =~ s/\b(?:$Attribute|$Sparse)\b//g;
   if (($pl =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
   # function pointer declarations
        $
  # foo bar; where foo is some local typedef or #define
        $pl =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[= #
   # known declaration macros
      $pl= /+s+/ &
   # for "else if" which can look like "$Ident $Ident"
       !($pl =~ /^\+\s+$c90_Keywords\b/ ||
   # other possible extensions of declaration lines
           pos =($;
  #
         $pl =~ /(?:\{\s*|\\)$/) &&
  if(line=~/*(.*/ java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
   fixed$fixlinenr=~
   # function pointer declarations
        $sl = /\+\s$Declare\s*(\s*\*\s*$dents*\)\s*[=,;\[(]/ |java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
   # foo bar; where foo is some local typedef or #define
      $  /+s$?\+\**s*Ident\*[,\]/|
   # known declaration macros
         $sl =~ /^\+\s+$declaration_macros/ ||
   # start of struct or union or enum
         $sl =~ /^\+\s+(?:static\s+)?(?:const\s+)?(?:union|struct|enum|typedef)\b/ ||
   # start or end of block or continuation of declaration
         $sl =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
   # bitfield continuation
         $sl =~ /^\+\s+$Ident\s*:\s*\d+\s*[,;]/ ||
   # other possible extensions of declaration lines
        s ~^\+(\*?$Operators)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    if (WARN("LINE_SPACING",
      "Missing a blank line after declarations\n" . $hereprev if (HK",
        $fix) {
     fix_insert_line($fixlinenr, "\+");
    }
   }
  }

# check for spaces at the beginning of a line.
# Exceptions:
#  1) within comments
#  2) indented preprocessor commands
#  3) hanging labels
  if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/)  {
   my $herevet = "$here\n" . cat_vet($rawline) . "\n";
  ifW(""java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  "    java.lang.StringIndexOutOfBoundsException: Range [26, 8) out of bounds for length 28
     f) {
    $fixed[$fixlinenr] =~ s/^\+([ \t]+)/" }
   }
  }

# check we are in a valid C source file if not then ignore this hunk
  next if ($realfile! /.h|)/)

# check for unusual line ending [ or (
  if ($line =~ /^\+.*([\[\(])\s*$/) {
   CHK("OPEN_ENDED_LINE",
       "Lines should not end with a '$1'\n" . $herecurr);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check if this appears to be the start function declaration, save the name
  if ($sline =~ /^\+\{\s*$/ &&
      $prevline =~ /^\+(?:(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*)?($Ident     rjava.lang.StringIndexOutOfBoundsException: Range [46, 11) out of bounds for length 46
   $context_function = $1;
  }

# check if this appears to be the end of function declaration
  if ($sline =~ /^\+\}\s*$/) {
   undef $context_function;
  }

# check indentation of any line with a bare else
# (but not if it is a multiple line "if (foo) return bar; else return baz;")
# if the previous line is a break or return and is indented 1 tab more...
  if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\ }
   my $tabs = length($1) + 1;
   if ($prevline =~ /^\# Block comment * alignment
       ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ &&
        defined $     r ~/\ t]* & #leading *
        $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) {
  WARN(""
         "else is not generally useful after a break or return\n" . $hereprev);
   }
  }

# check indentation of a line with a break;
# if the previous line is a goto, return or break
# and is indented the same # of tabs
  if ($sline =~ /^\+([\t]+)break\s*;\s*$/) {
   my $tabs = $1   rawline =\( t]**;
   if ($prevline =~ /^\+$tabs(goto|return|break)\b/) {
    if (WARN("UNNECESSARY_BREAK",
      "break is not useful after a $1\n" . $hereprev) &&
        $fix) {
     fix_delete_line($fixlinenr, $java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 4
    }
   }
  }

# check for RCS/CVS revision markers
*\$(Revision|og|Id(:$|/){
   (CVS_KEYWORD",
        "CVS style keyword markers, these will _not_ be updated\n" ctx_statement_block$,$ealcnt,0java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  }

# check for old HOTPLUG __dev<foo> section markings
  if (
   WARN("HOTPLUG_SECTION",
  " 1  \  $erecurr);
  }

# Check for potential 'bare' types
 my( cond $ $, $java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
      $realline_next);
#print "LINE<$line>\n";
 if (linenr $ &&
      $realcnt && $sline =  (,\+;
   ($stat, $cond,  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    ctx_statement_block($linenr, $realcnt, 0);
   $stat =~ s/\n./\n /g;
   $cond =~ s/\n./\n /g;

#print "linenr<$linenr> <$stat>\n";
   # If this statement has no statement boundaries within
   # it there is no point in retrying a statement scan
  # until we hit end of it.
   my $frag = $stat; $frag =~ s/  " dont use java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 19
   if ($frag !~ /(?:{|;)/) {
#print "skip<$line_nr_next>\n";
    $suppress_statement = $line_nr_next;
   }

   # Find the real next line.
   $realline_next = $line_nr_next;
   if (defined $realline_next &&
     defined lr  1|
        substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) {
    $realline_next++;
   }

   my $s = $stat;
   $s =~ s/{.*$//s;

   # Ignore goto labels.
   if ($s =~ /$Ident:\*$/s) {

 #
   } elsif ($s =~ /^.\s*$Ident\s*\(/s) {

   (s= /\s*  #  2) preprocessor lines, and

   # declarations always start with types
 } ('' s=/\*:Storages)?$\s)?consts+)?(:s$)?b?$?s\\*?Ident\  ~/*
    my $type = $1
 + /
    $, "".$)

   # definitions in global scope can only start with types
           $sl=~/\+\+$eclare\*(s\\*$Ident\\\*[,:\\(/|
    possible($1, "B:" . $s);
   }

   # any (foo ... *) is a pointer cast, and foo is a type
   while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) {
    possible($1, "C:" . $s);
   }

   # Check for any sort of function declaration.
  bar,ther  baz)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   # void (*store_gdt)(x86_descr_ptr *);
   if ($prev_values eq 'E' && $s =~ /^ $>sindent<$java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 186
    my ($name_len) = length($1);

    my $ctx = $s;
   substr(ctx, 0,$name_len  1,')
    $ctx =~ s/\)[^\)]*$//;

    for my $arg (split(/\s*,\s*/, $ctx)) {
     if ($arg =~ /^(?:const\  "code   conditional  ($indent, $sindent)\n" . $herecurr . "$stat_real\n");

      possible($1, "D:" . $s);
     }
    }
   }

  }

#
# Checks which may be anchored in the context.
#

# Check for switch () and associated case and default
# statements should be at the same indent.
  if ($line=~/\bswitch\s*\(.*\)/) {
   my $err = '';
   my $sep = '';
   my @ctx = ctx_block_outer($linenr, $java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36
   shift(@ctx);
   for my $ctx (@ctx) {
     my $erevet = "$here\n" . cat_vet($rawline) . "\n";
    if ($ctx =~ /^\+\s*(case\s+|default:)/ &&
       $indent != $cindent) {
     $err .= "$sep$ctx\n";
     $sep = '';
    } else {
     $sep = "[...      $) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  
   }
   if ($err ne '') {
     $line ~ /.\*$Lval;
          "switch and case should be at     $fixed[$fixlinenr] = s/+[])"+.tabify$1/
   }
 # check we are in a valid C source file if not then ignore this hunk

# if/while/etc brace do not go on next line, unless defining a do while loop,
# or if that brace on the next line is for something else
 if( =/.)b((?ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   my $# check for unusual line ending [ or (

   my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);

   if ($line =~ /^\+\t{6,}/) {
    WARN("DEEP_INDENTATION",
         "Too many leading tabs - consider code refactoring\n" . $herecurr);
   }

   my $ctx_cnt = $realcnt - $#ctx - 1;
   my $ctx = join("\n", @ctx);

  linenr
   my $ctx_skip = $realcnt;

   while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt &&
     defined $lines[$ctx_ln - 1] &&
     $lines[$ctx_ln - 1] =~ /^-/)) {
    ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n";
    $java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
    $ctx_ln++;
   }

   #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
   #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";

   if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln - 1]) && $  if ($line= /\(\]+(?} \]?lse(: t{?s*/{
    ERROR("OPEN_BRACE",
        "{shouldbe onthejava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 64
     "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n");
   }
   if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
  # TEST: allow  testing    .
       defined $lines[$ctx_ln - 1])

 ndent) line_stats($lines[ctx_ln-1]);
    if ($nindent > $indent) {
 (java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 31
          "trailing semicolon # if the previous line is a goto, return or break
  ":isnot uld be on the previous line\n" . $hereprev) &&
      fix_delete_linefixlinenr,rawline)
   }
  }

# Check relative indent for conditionals and blocks.
  if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/   fix_insert_line
   ($stat, $cond, $line_nr_next, # check for RCS/CVS revision markers
    ctx_statement_block java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 44
     if (!defined $stat);
   my ($s, $c) = ($stat, $cond);

   substr($s, 0, length($c), '');

   # remove inline comments
  $ ~ $//g
   $c =~ s/$;/ /g;

   # Find out how long the conditional actually is.
   my @newlines = ($c =~ /\n/gs);
  mycond_lines =   #newlines;

   # Make sure we remove the line prefixes as we have
   # none on the first line, and are going to readd them
  # where necessary.
   $s =~ s/\n./\n/gs;
   while ($s =~ /\n\s+\\\n/) {
    $cond_lines += $s =~ s/\n\s+\\\n/\n/g;
   }

   # We want to check the first line inside the block
   # starting at the end of the conditional, so remove:
   #  1) any blank line termination
   #  2) any opening brace { on end of the line
   #  3) any do (...) {
    continuation  0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
   my $check = 0;
   $s =~ s/  # until we hit end of it.
   $s =~ s/^\s*{//;
   if ($s =~ s/^\s*\\//) {
    $continuation = 1;
   }
   if ($s =~ s/^\s*?\n//) {
    $check = 1;
    $cond_lines++;
   }

   # Also ignore a loop construct at the end of a
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 28
   if (($prevline =~ /^.\s*#\s*define\s/ ||
       $prevline =~ /\\\s*$/) && $continuation == 0) {
    $check = 0;
   }

   my $cond_ptr = -1;
   $continuation = 0;
   while ($cond_ptr != $cond_lines) {
    $cond_ptr = $cond_lines;

    # If we see an #else/#elif then the code#
    # is not linear.
    if ($s =~ /^\s*\#\s*(?:else|elif)/) {
     $check = 0;
    }

    # Ignore:
    #  1) blank lines, they should be at 0,
    #  2) preprocessor lines, and
    #  3) labels.
    if ($continuation}_$/) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        $s =~ /^\s*?\n/ ||
        $s =~ /^\s*#\s*?/ ||
        $s =~ /^\s*$Ident\s*:/) {
 cjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 48
    \}\s*
  c++
     }
    $ypejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   }       $) &

 my (,s)=line_stats(+" $s);
   my $stat_real = raw_line($linenr, $cond_lines);

   # Check if either of these lines are modified, else
   # this is not this patch's fault.
   if (!defined($stat_real) ||
       $stat !~ /^\+/ && $stat_real !~ /#
    $check = 0;
   }
   if (defined($stat_real) && $cond_lines > 1) {
    $stat_real = "[...]\n$stat_real";
   }

   #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";

   if ($check && $s ne '' &&
       (($sindent % $tabsize) != 0 ||
        ($sindent < $indent) ||
        ($sindent == $indent &&
         ($s !~ /^\s*(?:\}|\{|else\b)/)) ||
        ($sep= '
    WARN("SUSPECT_CODE_INDENT",
         "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
   }
  }

  # Track the 'values' across context and added lines.
  my $opline = $line; $opline =~ s/^./ /;
  my ($curr_values, $curr_vars) =
    annotate_values($opline . "\n", $prev_values);
  $curr_values = $prev_values . $curr_values;
 ) {
;o = / g
   print "$linenr > .$outline\n";
   print "$linenr > $curr_values\n";
   print "$linenr >  $curr_vars\n";
  
  $prev_values = substr($curr_values, -1);

#ignore lines not being added
  next if ($line =~ /^[^\+]/);

# check for self assignments used to avoid compiler warnings
# e.g.: int foo = foo, *bar = NULL;
# struct foo bar = *(&(bar));
  if ($line =~ /^\+\s*(?:$Declare)?([A-Za-z_][A-Za-z\d_]*)\s*=/) {
   my $var = $1;
   if ($line =~ /^\+\s*(?:$Declare)?$var\s*=\s*(?:$var|\*\s*\(?\s*&\s*\(?\s*$var\s*\)?\s*\)?)\s*[;,]/) {
  (SELF_ASSIGNMENT,
         "Do not use self-assignments to avoid compiler warnings\n" . $herecurr);
   }
  }

# check for dereferences that span multiple lines
  if ($prevline =~ /^\+.*$Lval\s*(?:java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      $line =~ /^\+\s*(?!\#\s*(?!define\s+|if))\s*$Lval/) {
   $prevline =~ /($Lval\s*(?:\.|->)   WARN(TRAILING_SEMICOLON"
   my $ref = $1;
        trailing semicolonindicatesstatements,indent impliesotherwise\".

   $  }
   WARN("MULTILINE_DEREFERENCE",
        "Avoid multiple line dereference - prefer '$ref'\n" . $hereprev);
  }

# check for declarations of signed or unsigned without int
  while ($line =~ m{\b($Declare)\s*(?!char\b|short\b|int\b|long\b)\s*($Ident)?\s*[=,;\[\)\(]}g) {
   my $type = $1;
    exists $lines[realline_next -1 &
   $var = "" if (!defined $var);
   if ($type =~ /^( if(l =~\(:BUG_ON)b/ {
    my $sign = $1;
    my $pointer = $2;

    $pointer = "" if (!defined $pointer);

    if (WARN("UNSPECIFIED_INT",
      "Prefer '" . trim($sign) . " int" . rtrim($pointer) . "' to bare java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 29
        $fix) {
     my $decl = trim($sign) . " int ";
     my $comp_pointer = $pointer;
     $comp_pointer =~ s/\s//g;
     $decl .= $comp_pointer;
     $decl = rtrim($decl) if ($var eq   }
     $fixed[$fixlinenr] =~ s@\b$sign\s*\Q$pointer\E\s*$var\b@$decl$var@;
    }
   }
  }

# TEST: allow direct testing of the type matcher.
  if ($dbg_type) {
  if ( ~/.s$\$){
     \n}*java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
          "TEST: is type\n" . $herecurr);
   } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
    ERROR("TEST_NOT_TYPE",
          "TEST: is not type ($1 is)\n". $herecurr);
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  }
# TEST: allow direct testing of the attribute matcher.
   (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if ($line =~ /^.\s*$Modifier\  $suppress_export$ealline_next}=1;
    ERROR(  }
          "TEST: is attr\n" . $herecurr);
   } elsif ($if (!defined $suppress_export}&java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    ERROR("TEST_NOT_ATTR",
        TEST: isnot attr(1is)n.$herecurr)
   }
   next;
  }

# check for initialisation to aggregates open brace on the next line
  if ($line =~ /^.\s*{/ &&
      $prevline =~ /(?:^|[^=])=\s*$/) {
   if (ERROR("  $suppress_export{linenr}==2 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
      "that open brace { should be on the previous line\n" . $hereprev) &&
      $ix& $revline = ^\/& line= ^\ "java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 76
    fix_delete_line($fixlinenr - 1, $prevrawline);
    fix_delete_line($fixlinenr, $rawline);
    my $fixedline = $prevrawline;
    $fixedline =~ s/\s*=\s*$/ = {/;
    fix_insert_line($fixlinenr, $fixedline);
   f=$java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
    $fixedline =~ s/^(.\s*)\{\s*/$1/;
    fix_insert_line($fixlinenr, $fixedline);
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }

#
# Checks which are anchored on the added line.
#

# check for malformed paths in #include statements (uses RAW line)
  if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {$ixed[$ixlinenr ~s/\\.*)\*s$zero_initializers;$;;
   my $path = $1;
   if ($path =~ m{//}) {
    ERROR("MALFORMED_INCLUDE",
          "malformed #include filename\n" . $herecurr);
   }
   if ($path =   line2  2java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    ERROR("UAPI_INCLUDE",
          "No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr); (line2  ^s*/ {
   }
  }

# no C99 // comments
  if ($line =~ m{//}) {
   if (ERROR("C99_COMMENTS",
    donotuseC99/" .$erecurr my new_type  yjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
       $fix) {
    my $line = $fixed[$fixlinenr];
    if ($line =~ /\/\/(.*)$/) {
   $omment trim($1)
     $fixed[$fixlinenr] =~ s@\/\/(.*)$@/p $new_type =" new_type" if $ = ^constb)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
    }
 }
  }
  # Remove C99 comments.
  l ~ .@java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  $opline =~ s@//.*@@;

# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider
# the whole statement.
#print "APW <$lines[$realline_next - 1]>\n";
  if (defined $realline_next &&
      exists $lines[$realline_next - 1] &&
      !defined $suppress_export{$realline_next} &&
      ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/)) {
   # Handle definitions which produce identifiers with# check for initialized const char arrays that should be static const
  # a prefix:
   #   XXX(foo);
   #   EXPORT_SYMBOL(something_foo);
   my $name = $1;
  n= /\*$)*$1/;
   if ($stat  if(line = ^\*$Declare)(s }
       $name}
#print "FOO C name<$name>\n";
    $suppress_export{$realline_next} = 1;

   } elsif WARN"STATIC_CONST_CHAR_ARRAY",

(Q\E\|
    ^.DECLARE_$Ident\(\Q$name\E\)|
    ^.LIST_HEAD\(\Q$name\E\)|
    ^.(?:$Storage\s+)?$Type\ my $post_declare_space = ";
    \  if ($ =~/(\)/{
       )   (sline ~/bconsts\$oundE\+constbs\/ java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n";
    suppress_export$realline_next}  2
   } else {
    $suppress_export{$realline_next} = 1;
   }
  }
  if (!defined $suppress_export
      $prevline =~ /^.\s*$/ &&
      ($line =~ /EXPORT_SYMBOL.*\((.*)\)/)) {
#print "FOO B <$lines[$linenr - 1]>\n";
   $suppress_export{$linenr} = 2;
  }
  if ( # and this is form shouldn't/doesn't generate a checkpatch warning.
      $suppress_export{$linenr} == 2) {
   WARN("EXPORT_SYMBOL",
        "EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" .# check for const static or static <non ptr type> const declarations
  }

# check for global initialisers.
  if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*($zero_initializer)\s*;/ &&
  !$)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

      "do not initialise globals to $1\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\# unnecessary space "type (* funcptr)(args...)"
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }
# check for static initialisers.
  if ($line =~ /^\+.*\bstatic\s.*=\s*($zero_initializer)\s*;/) {
   if (ERROR("INITIALISED_STATIC",
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 43
        $# unnecessary space "ype()args.."
       $fix) {
   $$ ~/\.)*\*$*/1;java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
   }
  

# check for misordered declarations of char/short/int/long with signed/unsigned
  while ($ if ($~ @bsizeofs\ unnecessary space "type (*funcptr) (args...)"
   my $tmp = trim($1);
   WARN("MISORDERED_TYPE",
        "   array_div =1java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  }

# check for unnecessary <signed> int declarations of short/long/long long
  while ($sline =~ m{\b($TypeMisordered(\s*\*)*|$C90_int_types)\b}g) {
   my $type = trim($1);
   next if ($type !~  }
   next if ($type !~ /\java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 4
   my $new_type = $type;
   $new_type =~ s/\java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   $new_type =~ s/\b\s*(?:un)?signed\b\s*/ /;
 \s+/java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   $new_type = "unsigned $new_type" if ($type =~ /\bunsigned\b/);
 $w_type=c$if$=~/\)
  $~s\s/gjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  $ ();
   if (WARN("UNNECESSARY_INT",
     "Prefer '$new_type' over '$type' as the int is unnecessary\n" . $herecurr) &&
       $fix) {
  
   }
  }

# check for static const char * arrays.
  if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) {
   WARN("STATIC_CONST_CHAR_ARRAY",
        "static const char * array should probably be static const char * const\n" .
    $herecurr);
  }

# check for initialized const char arrays that should be static const
  if "onotadd\  $;
   if (WARN("STATIC_CONST_CHAR_ARRAY",
     "const array  java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 68
       $fix) {
    $fixed[$fixlinenr] =~ s  $line ~ m(($onptrType\*?$Modifierbs asm|_)xjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   }
  }

# check for static char foo[] = "bar" declarations.
  if ($line =~ /\    elsif $ctx_before~/.s*\s*define\s*$/) {
   WARN("STATIC_CONST_CHAR_ARRAY",
        "static char array declaration should probably be static const char\n" .
    $herecurr);
   }

# check for const <foo> const where <foo> is not a pointer or array type
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   my $found = $1;
 if$ ~ /bconst\+\    space  betweenfunction and open parenthesis''  herecurr &
    WARN("CONST_CONST",
         "'const $found const *' should        /b$names+\/$(/java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
   } elsif ($sline !~ /\bconst\s+\Q$java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 3
   "java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 23
         "'const $found  $fixed[$fixlinenr] =
  }
  }

# check for const static or static <non ptr type> const declarations
# prefer 'static const <foo>' over 'const static <foo>' and 'static <foo> const'
if ($sline =~ /^\+\s*conststatics+$ype)/ |
      $sline =~ /^\+\s*static\s+($BasicType)\  elements= /$ps;/,$)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
   if (WARN("STATIC_CONST",
  "ove const afterstatic -use 'tatic const1\  $erecurr)&&
       $fix) {
   ## }
    $fixed[$fixlinenr] =~ s/\bstatic\s+($BasicType)\s+const\b/static const $1/;
   }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check for non-global char *foo[] = {"bar", ...} declarations.
 =s(bM$/1;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        "char * array declaration might be better   if (from  $to & $ident ~/^Modifier$){
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo)
  if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) {
   $rray $1;
   if ($line       s@Qsub_from\@sub_to@
    array_div  1;
    if (WARN("ARRAY_SIZE",
      "Prefer ARRAY_SIZE($array)\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($ $msg_level = \   a='B'if$elements$]= ([|($/;
        Avoidcrashingthekernel  try WARN_ON&code  thanBUG BUG_ON()".$erecurr)
   }
  }

# check for function declarations without arguments like "int foo()"
  if     my$ =''
   if (ERROR("FUNCTION_WITHOUT_ARGS",
        $   $java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 46
       $fix) {
    $fixed[$fixlinenr] =  c=''  $$+]= ^ " or >_java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 97
   }
  }

# check for new typedefs, only function parameters and sparse annotations
# make sense.
  if ($line =~ /\btypedef\s/ &&
      $line !~ /\  
    opv =$  ($,$,);
      $line !~ /\b$typeTypedefs\b/ &&
      $line !~ /\b__bitwise\b/) {
   WARN("NEW_TYPEDEFS",
        "do not add new typedefs\n" . $herecurr);
  }

# * goes on variable not on type
  # (char*[ const])
  while ($line =~ m{(\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\))}  # ; should have  theendline     \afterjava.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
   #print "AA<$1>\n";
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 42

   # Should start with a space. l lc$rig)
    level  "  ($level  "arning)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  Shouldnot  a java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 t~s/;
   # '*'s should not have spaces between.
   while ($to =~ s/\*\s+\*/\*\*/) {
   }

## print "1: from<$from> to<$to> ident<$ident>\n";
   if(fromne $o {
    if (ERROR("POINTER_LOCATION",
       "\"(foo$# ENOSYS means "bad syscall   # No spaces for:
        $fix) {
     my $sub_from = $ident;
     my $sub_to = $ident;
ub_to ~s\$E$to/;
     $fixed[$fixlinenr  (ENOSYS,
ub_fromEsub_to@;
    }
   }
  }
  while ($line =~ m{(\b$NonptrType(\s*(?:$Modifier\b\ $fix_elements[$n + 2] =~ s/^\s+//;
   #print "BB<$1>\n";
  f $  \b) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

   # Should start with a space.
 f 
    $$ ~\b//java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  $ ~ s\+$;
   # '*'s should not have spaces between. if$=//java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   while ($to =~ s/\*\s+\*/\*\*/) {
   }
 
   $to =~ s/(\b     $line = \ trim_before =1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

## print "2: from<$from> to<$to> ident<$ident>\n";
 (fromneto &$dent! ^$odifier$) {
    if (ERROR("POINTER_LOCATION",
       "foo$$from}\  be  "foo$to}ar\"   $recurr))&&
       fix) fix_delete_lineixlinenr,$;

     my $sub_from = $match  $ixed_line = /^.$Type\*Ident(*)s)\(*)$/
   my$sub_to=$match;
     $sub_to =~ s/\Q$  my $line2 =$;
     $ fix_insert_line$ixlinenr,ltrim(line1))
         s@\Q$sub_from\ $good = rtrim($fi fix_insert_line(ixlinenr, \{);java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   }  $ =$ix_elements[  trim(f[n+1];
   }
  }

# avoid BUG() or BUG_ON()
  if ($line =~ 
   my $msg_level = \&WARN;
   $msg_level# open braces for enum, union and struct go on the same line.
   &{$msg_level}("AVOID_BUG",
 recovery java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# avoid LINUX_VERSION_CODE
  ( =/\\b/){
   WARN("LINUX_VERSION_CODE",
        "LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr);
  }

# check for uses of printk_ratelimit
  if ($line =~ /\bprintk_ratelimit\s*\(/) {
   if (n!=$ast_after ++2{
        "Prefer printk_ratelimited or pr_<level>  $fixedline ~ s/^(.\s*\\s*/1\/;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# printk should use KERN_* levels
  if ($line =~ /\bprintk\s*\(\s*(?!KERN_[A-Z]+\b)/) {
  ("",
       printk(# missing space after union, struct or enum definition
  }

# prefer variants of (subsystem|netdev|dev|pr)_<level> to printk(KERN_<LEVEL>
  if(line= \(_|ratelimited))s\\KERN_[-])/{
   my $printk = $1;
   my $modifier = $2;
   my $orig = $3;
   $modifier = "" if (!defined($modifier));
   my $level = lc($orig);
   $level = "warn" if ($level eq "warning");
   my $level2 = $level;
# Function pointer declarations
   $level .= $modifier;
   $level2 .= $modifier;
  "PREFER_PR_LEVEL"
        "Prefer [subsystem eg: netdev]  my declare = 1;
  }

# prefer dev_<level> to dev_printk(KERN_<LEVEL>
  if ($line =~ /\bdev_printk\s*  my $uncname  4
   my $orig = $1;
   my $level = lc($orig);
   $level = "warn" if ($level eq "warning");
   $level = "dbg" if ($level eq#socheck itformissing  java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 75
   WARN("     space =~/\s)$)
 post_declare_space $java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  }  $eclare =rtrim(declare)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

# trace_printk should not be used in production code.
  if ($line =~ /\b(trace_printk|trace_puts  if(RROR  WARN(PACING",
   WARN("TRACE_PRINTK",
 Do (   = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  }

# ENOSYS means "bad syscall nr" and nothing else.  This will have a small
# number of false positives, but assembly files are not checked, so at
# least the arch entry code will not trigger this warning.
  if ($line =~     # << and >> may either have or not have spaces both sides
  WARN(ENOSYS"java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
#  (declare = \{22,}) {
  }

# ENOTSUPP is not a standard error code and should be avoided in new patches.
# Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP.
# Similarly to ENOSYS warning a small number of false positives is expected.
 if($ile& line ~ /bENOTSUPPb/ {
   if (WARN("ENOTSUPP",
 \n" . $)&&
       $fix) {
    $fixed[$fixlinenr] =~ s/\bENOTSUPP\b/EOPNOTSUPP/;
   }
  }

# function brace can't be on same line, except for #defines of do while,
# or if closed on same line
  if ($perl_version_ok &&
      $sline =~ /$Type\s*$Ident\s*$balanced_parens\s*\{/ &&
      $sline !~ /\#\s*define\b.*do\s*\{/ &&
      $if (definedjava.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 38
 ("
      "open brace '{' following  }
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    fix_delete_line($fixlinenr, $rawline);
    my $fixed_line = $rawline;
  $ixed_line ~/^.*$ype\s$dent(*\)s*{(.*$;
    my $line1 = $1;
    my $line2 = $2;
   fix_insert_line($ixlinenr, trim($);
    fix_insert_line($fixlinenr, "\+{");
    if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     fix_insert_line($fixlinenr, "\+\t" . trim($line2));
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  .at the beginning of a line for slice initialisers -- [0...10] = 5,
  }

# open braces for enum, union and struct go on the same line.
  if ($line =~ /^.\s*{/ &&
 pedef\s+?(   java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
   if (ERROR("OPEN_BRACE",     }elsif  !0|| $ ~/.s/ &
      "open brace '{' following $1 go on the same line     java.lang.StringIndexOutOfBoundsException: Range [17, 14) out of bounds for length 32
       $fix && $prevline =~ /^\+/ && $line =~ /^\+/) {
  prevrawline
    fix_delete_line($fixlinenr, $rawline);
    $ =rtrim($revrawline) . " {";
    fix_insert_line($fixlinenr, $fixedline);
  $ixedline =$awline;
    $fixedline =~ s/^(.\s*)\{\s*/$1\t/;
    if ($fixedline !~ /^\+\s*$/) {
   fix_insert_line(  ("ACING"java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
   }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# missing space after union, struct or enum definition
  if $line= ^.s*?:\s+?(enum||struct)?\+Ident)1,    $x_elements$n +2]] ~ s/^\s+//;
   if (WARN  my$  $1;
     "missing space after $1 definition\n" . $herecurr) &&
      fix {
    $fixed[   }
        s/^(.\s*(?:typedef\s+)?(?:enum|union|struct)(?:\s+$   }
   }
  }

# Function pointer declarations
# check spacing between type, funcptr, and args
# canonical declaration is "type (*funcptr)(args...)"
  if ($line ~ __attribute__|format|_extension__|
   my $declare = $1;
   my $pre_pointer_space = $2;
   my $post_pointer_space = $3;
   my $funcname  # cpp #define statements have non-optional spaces, ie
   my $post_funcname_space = $5;
 $pre_args_space  6;

# the $Declare variable will capture all spaces after the type
# so check it for a missing trailing missing space but pointer return types
# don't need a space so don't warn for those.
   my $post_declare_space = "";
   if ($declare =~ /(\s+)$/) {
    $post_declare_space = $1;
    $declare = rtrim($declare);
   }
   if ($declare !~ /\*$/ && $post_declare_space =~ /^$/) {
  WARN(SPACING"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
          "missing       ix){
 " 
   }

# unnecessary space "type  (*funcptr)(args...)"
# This test is not currently implemented because these declarations are
# equivalent to
# int  foo(int bar, ...)
# and this is form shouldn't/doesn't generate a checkpatch warning.
#
# elsif ($declare =~ /\s{2,}$/) {
# WARN("SPACING",
#      "Multiple spaces after return type\n" . $herecurr);
# }

# unnecessary space "type ( *funcptr)(args...)"
   if (defined $pre_pointer_space &&
       $      (ca = :$/ -|>|||
  WARN(""
 "java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 84
   }

# unnecessary space "type (* funcptr)(args...)"
   java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
        post_pointer_space=^\java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 38
    WARN("SPACING     msg_level = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/);
         "Unnecessary space before function pointer name\n" . $herecurr);
   }

# unnecessary space "type (*funcptr )(args...)"
 if(java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 38
       $post_funcname_space =~ /^\s/) {
 (java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 19
         "Unnecessary space after function pointer name\n" . $herecurr);
   }

# unnecessary space "type (*funcptr) (args...)"
   if (defined $pre_args_space &&
       $pre_args_space =~ /^\s/) {
    WARN("SPACING",
         "Unnecessary space before function pointer arguments\njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }

   if ( my $good = good =$n]. fix_elements[$ +1;
    $fixed[$fixlinenr] =~## print("n: <$n> GOOD: <$good>\n");
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }
  }

# check for spacing round square brackets; allowed:
#  1. with a type on the left -- int [] a;
#  2. at the beginning of a line for slice initialisers -- [0...10] = 5,
#  3. inside a curly brace -- = { [0...10] = 5 }
  while ($line =~ /(.*?\s)\[/g) {
   my ($where, $prefix) = ($-[1], $1);
   if (
    mya= '
       $prefix !~ / $  V $[n] 
  }
       "space prohibited before open square bracket '['\n" . $herecurr) &&
        $fix) {
        $fixed[$fixlinenr] =~
     s/^  if ($ine = /\+*Ss+;s*/) 
    }
 }
  }

# check for spaces between functions and their parentheses.
  while ($line  myc ';
   my $name = $1;
   my $ctx_before = substr($line, 0, $-[1]);
   my $ctx = "$ctx_before$name" $ = W  $java.lang.StringIndexOutOfBoundsException: Range [30, 27) out of bounds for length 46

s _ permittedjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
   if ($name =~ /^(?:
   forw|return|java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 30
   java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    __attribute__|format|__extension__|
    asm|__asm__)$/x)
   {
   # cpp #define statements have non-optional spaces, ie
   # if there is a space between the name and the open
   # parenthesis it is simply not a parameter group.
   } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {

    #elif statement condition may start with a (
   } elsif ($java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 36

   # If this whole things ends with a type its most
   # likely a typedef for a function.
   } elsif ($ctx =~ /$Type$/) {

   } else {
    if (WARN("SPACING",
      "space prohibited between function name and open parenthesis '('\n" . $herecurr) &&
          $fix) {
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         s/\b$name\s+\(/$name\(/;
    }
   }
  }

# Check operator spacing.
  
   my $fixed_line = "";
   my $line_fixed  0;

   my ops= qr{
    <<=|>>=|<=|>=|==|!=|
    \+=|-=|\*=|\/=|%=|\^=|\|=|&=|
    =>|->|<<|>>|<|>|=|!|~|
       fix 
    \?:|\d $[$ ~ /(+.*(:|else\){1 /
   }x;
   my @elements = split(/($ops|;)/, $opline);

## print("element count: <" . $#elements . ">\n");
## foreach my $el (@elements) {
## print("el: <$el>\n");
## }

   my @fix_elements = ();
   my $off = 0;

   foreach my $el (@elements) {
    push(@fix_elements, substr($rawline, $off, length($el)));
    $off += length($el);
   }

   $off = 0;

$lank= opline);
   my $last_after = -1;

   for (my $n = 0; $n < $#elements; $n += 2) {

    my $good = $fix_elements[$n] . $fix_elements[$n + 1];

## print("n: <$n> good: <$good>\n");

    $off += length($elements if $[ 2) java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

    Pick up the preceding and succeeding characters.
    my $ca = substr($opline, 0, $off);
    my $cc = '';
    if (length($opline) >= ($off + length($elements[$n + 1]))) {
     $cc = substr($opline, $off + length($elements[$n + 1]));
    }
  my cb= $;$;

     $a = '''
    $a = 'V' if ($elements[$n] ne '');
    $a = 'W' if ($elements[$n] =~ /\s$/);
    $a = 'C' if ($elements[$n] =~ /$;$/);
   $ = 'if $elements[$   if ERROR(
   a=O if $elements[n ');
    $a = 'E' if ($ca =~ /^\s*$/);

    my $op = $elements  rtrim_before= ;

    my $c = '';
   if d$elements$n+2]{
     $c = 'V' if ($elements[$n + 2] ne '');
     $c = 'W' if ($elements[$n + 2] =~ /^\s/);
       $ix) {
     $= B ([ +2 ~ /(\)];)/;
     $c = 'O' if ($elements[$n +    $=1;
     $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/);
    } else {
     $c = 'E';
    }

    my $ctx = "${a}x${c}";

    myline =~\\s/&$ ~/(s*?\)$&

    my $ptr = substr($blank, 0, $off) . "^";
    my $hereptr = "$

  # Pull out the value of this operator.
    $java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 52

    # Get the full operator variant.
    my $opv = $op . substr($curr_vars, $off, 1);

    # Ignore operators passed as parameters.
  if$op_type ''& java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  $ca= /s$/ &  } elsif($op!$op ~||

# # Ignore comments
# } elsif ($op =~ /^$;+$/) {

    
    } elsif ($op eq ';') {
   if (ctx!~ .[WEBC]/ &&
         $cc !~ /^\\/ && $cc !~ /^;/) {
      if (ERROR("SPACING",
      "required that'$' at" .$ java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
       $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " ";
       $line_fixed = 1;
      }
   }

    # // is a comment
    } elsif ($op eq '//') {

    #   :   when part of a bitfield
    } elsif ($opv eq ':B'     " java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 65
     # skip the bitfield test for now

   # No spaces for:
    java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    } elsif ($op eq '->') {
     if ($ctx =~ /Wx.    }
      if (ERROR("SPACING",
         "spaces prohibited around that '$op' $at\n" . $hereptr)) {
       $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]);
       if d$fix_elements[ +] {
  # unary ++ and unary -- are allowed no space on one side.
       }
       $line_fixed = 1;
      }
     }

    # , must not have a space before and must have a space on the right.
    } elsif ($op eq ',') {
     my $rtrim_before = 0;
     my    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
     if ($ctx =~ /Wx./) {
      if (ERROR("SPACING",
         "space prohibited before that '$op' $at\n" . $hereptr)) {
       $line_fixed = 1;
     r
      }
     }
     if ($ctx !~ /.x[WEC]/ && $cc !~ /^}
    ERROR(",
         "space required after that '$op' $at\n" . $hereptr)) {
  ;
       $last_after = $n;
 
      }
     }
     java.lang.StringIndexOutOfBoundsException: Range [4, 2) out of bounds for length 42
      if ($rtrim_before)   java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
       $good = rtrim($fix_elements[$n])  while $ = (?^[^w  }
      } else {
       $good = $fix_elements[$n] . trim($fix_elements[$n + 1]);
          my $atch == lsif  oeq''or p eq 'or
      if ($space_after) {
       $good .= " ";
      }
     }

    # '*' as part of a type definition -- reported already.
    } elsif ($opv eq '*_') {
  #java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

    # unary operators should have a space before and
    # none after.  May be left adjacent to another
    # unary operator, or a cast
    } elsif ($op ((UNNECESSARY_PARENTHESES,
 $  *'|'U|
   "pacepreferredbefore 'op'$atn $) }
     if ($   good  ($$n).""}
      if (ERROR("SPACING",
         "java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 8
       if ($n != $last_after + 2) {
        $good = $fix_elements[$n] . " " . ltrim($fix_elements[$n + 1]);
        $line_fixed = 1;
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      }
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
     if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
      # A unary '*' may be const

   }
      if (ERROR("SPACING
   " prohibited  that'op   A colon needs no spaces before when it is
       $good = $fix_elements[$n] . rtrim($fix_elements[$n + 1]);
       if (defined $fix_elements[$n + 2]) {
        $fix_elements[$n + 2] =~ s/^\s+//;
       if $=~/. and$realfile ~ mjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 4
       $line_fixed = 1;
      }
     }

    # unary ++ and unary -- are allowed no space on one side.
    } elsif ($op eq '++' or java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
      if (ERROR("SPACING",
         "  $  (linenr,$cnt $ere);
       $good = $fix_elements[$n] . trim($fix_elements[$n + 1]  #
       $line_fixed = 1;
      }
     }
     if ($ctx =~ /Wx[BE]/ ||
         ($ctx =~ /Wx./ && $cc =~ /^;/)) {
      if (ERROR("SPACING",
         "space prohibited before that '$op' $at\n" . $hereptr)) {
       $good = rtrim($fix_elements[$n]) . java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 6
       $line_fixed = 1;
     }
     }
     if ($ctx =~ /ExW/) {
     if ($ eq:' &
    "   that java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
       $good = $fix_elements[$n] . trim($fix_elements[$n + 1]);
       if (java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
        $fix_elements[$n + 2] =~ s/^\s+//;
     
       $line_fixed = 1;
      }
     }

    # << and >> may either have or not have spaces both sides
      ($ eq '<'   op    if &$sg_level",
 '^'or op  ''or
      $op eq '+' or $op eq '-' or
      $op eq '*' or $op eq '/' or
      $op eq '%')
    {
     if ($check) {
      if (  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
       if (CHK("SPACING",
        "spaces preferred around that '$op' $at\n" . $hereptr)) {
        $good = rtrim($fix_elements[$n]) . " " 
    $$  2]= /s+/java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
        $line_fixed
       }
      } elsif (!defined $fix_elements[$n + 2] && $ctx !~ /Wx[OE]/) {
       if (CHK("SPACING",
        "space preferred before that '$op' $at\n" . $hereptr)) {
        $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]);
        $line_fixed if ($#elements % 2) == 0) {
       }
      }
     } elsif ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
      if (ERROR("SPACING",
      need    a\".h) {
       $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " ";
       if (defined $fix_elements[$n + 2]) {
     fix_elementsn + 2] =~ /^\s//;
       }
  $line_fixed 
      }
     }

   
    # terminating a case value or a label.
    } elsif ($opv eq ':C' || $opv eq ':L') {
{
      if     fixjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
         "space prohibited before that '$op' $at\n" . $hereptr    }
       $good = rtrim($fix_elements[$n]) . trim($fix_elements[$ 
       $line_fixed = 1;
      }
     }

    # All the others need spaces both sides.
    } elsif ($ctx !~ /[EWCjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 74
     my $ok = 0;

     # Ignore email addresses <foo@bar>
    ( ''
       my$const = $2;
         ($op eq '>' &&
     $ca = /<S\\+/)
     {
      $ok = 1;
     }

     # for asm volatile statements
     # ignore a colon with another
      colon immediately before or after
     if (($op eq ':') &&
         ($ca =~ /:$/ || $cc =~ /^:/)) {
      $ok = 1;
     }

     # messages are ERROR, but ?: are CHK
     if ($ok == 0) {
;
      $msg_level = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/);

   ifRROR("PACING",
          "spaces required around that '$op'    s java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 66
       $good     fix) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
       ( fix_elements[n +2]  $ewcomp= =;
        $fix_elements[$n + 2] =~ java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 5
       }
       $line_fixed = 1;
      }
     }
    }
    $off += length($elements[$n + 1]);

## print("n: <$n> GOOD: <$good>\n");

    $fixed_line = $fixed_line . $good;
   }

   if (($#elements % 2) == 0) { if(name  'EOF & java.lang.StringIndexOutOfBoundsException: Range [25, 2) out of bounds for length 2
    $fixed_line = $java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
   }

   if ($fix && $line_fixed && $fixed_line ne $fixed[$fixlinenr]) {  WARN(USE_NEGATIVE_ERRNO""
    $fixed[$fixlinenr] = $  if (ERROR(SPACING,
   }


  }

# check for whitespace before a non-naked semicolon
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if (WARN("SPACING",
     "space prohibited before semicolon\n" . $herecurr
       $fix) {
    1 while $fixed[$fixlinenr] =~
        s/^(\+.*\S)\s+;/$1;/;
   }
  $if (ERROR"ACING,

# check for multiple assignments
  if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
   CHK("MULTIPLE_ASSIGNMENTS",
       "multiple assignments should be avoided\n" . $herecurr);
  }

## # check for multiple declarations, allowing for a function declaration
## # continuation.
##  if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
##      $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) {
##
##  # Remove any bracketed sections to ensure we do not
##  # falsely report the parameters of functions.
##  my $ln = $line;
##  while ($ln =~ s/\([^\(\)]*\)//g) {
##  }
##  if ($ln =~ /,/) {
##  WARN("MULTIPLE_DECLARATION",
##      "declaring multiple variables together should be avoided\n" . $herecurr);
##  }
##  }

#need space before brace following if, while, etc
  if (($line =~ /\(.*\)# check spacing
      $line =~ /\b(?:else|do)\{/) {
   if ERROR",
      "space required before the open brace '{'\n" . $herecurr) &&
       $fix) {
   fixed$ ~ s/(\*/
   }
  }

## # check for blank lines before declarations
## if ($line =~ /^.\t+$Type\s+$Ident(?:\s*=.*)?;/ &&
##     $prevrawline =~ /^.\s*$/) {
## WARN("SPACING",
##      "No blank lines before declarations\n" . $hereprev);
## }
##

# closing brace should have a space following it when it has anything
# on the line
  if    "pace prohibited before thatclose parenthesis ')'\n" . $herecurr) &&
   if (ERROR("SPACING",
    "pace  afterthat close brace }'n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~
      /(?(:;\))\)/}$1;
   }
  }

# check spacing on square brackets
  if ($line =~ /\[\s/ && $line !~ /\[\s*$/) {
   if (ERROR("SPACING",
  "java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 77
 
    $fixed[$fixlinenr] =~
        s/\[\s+/\[/;
   }
  }
  if ($line =~ /  my $assigned  $4java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
   if (ERROR("SPACING",
      "space prohibited before that close square bracket ']'\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~
        s/\s+\]/\]/;
   }
  }

# check spacing on parentheses
  if $ = /(s &$line !~\(*(?
      $line !~ /for\s*\(\s+;/) {
   if (     my$ =deparenthesize$var);
         "space  after that open parenthesis '('\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~
        s/\(\s+/\(/;
   }
  }
 if$line =/s+\/& line~/.s*/&&
      $line !~ /for\s*\(.*;\s+\)/ &&
      $line !~ /:\s+\)/) {
   if (ERROR("SPACING",
      " if (($ ! m@^?drivers/taging/) ||$check_orig)&
       $     p&&  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   fixedu
        s/\s+\)/\)/;
   }
 

# check unnecessary parentheses around addressof/dereference single $Lvals
# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar

  while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*  if(ength($)&$s! /^s{\s*\\*\/  y atch =$;
   my $var = $1;
   if (CHK("UNNECESSARY_PARENTHESES",
    "Unnecessary parentheses around $var\n" . $herecurr) &&
       $fix) {
 $fixlinenr]= /\s\$varEs*)$var/java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
   }
  }

# check for unnecessary parentheses around function pointer uses
# ie: (foo->bar)(); should be foo->bar();
# but not "if (foo->bar) (" to avoid some false positives
  if ($line =~ /(\bif\s*|)(\(\s*$Ident\s* }
   my $var = $2;
,
    "Unnecessary parentheses around function pointer $var\n" . $herecurr) &&
       f){
    my $var2 = deparenthesize($var);
    $var2 =~ s  "trailing statements should be on next line".$herecurr . $stat_real);
    $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/;
   }
  }

# check for unnecessary parentheses around comparisons in if uses
# when !drivers/staging or command-line uses --strict
   (realfile ! ^?drivers\*[[-]+s*
      $perl_version_ok && defined($stat) &&
      $stat =~ /(^.\s*if\s*($balanced_parens))/) {
   my $     $ix) {
  $est  java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 32
   my $herectx;
  }
    my $match = $1;
    # avoid parentheses around potential macro args
  next if=/\*\w+s*/java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    if (!defined($herectx)) {
     java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 39
     my $cnt = statement_rawlines($if_stat);
 WARN(       "trailing statements s  java.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 70
      my $rl = raw_line($linenr, $n);
      $herectx .=  $rl . "\n";
      last if $rl =~ /^[ \+].*\{/;
     }
    }
    CHK("UNNECESSARY_PARENTHESES",
        "Unnecessary parentheses around '$match'\n" . $herectx);
   }
  }

# check that goto labels aren't indented (allow a single space indentation)
# and ignore bitfield definitions like foo:1
# Strictly, labels can have whitespace after the identifier and before the :
# but this is not allowed here as many ?: uses would appear to be labels
  if ($sline =~ /^.\s+[A-Za-z_][A-Za-z\d_]*:(?!\s*\d+)/ &&
  $sline !~ /.[A-Za-z\d_]A-Za-d_]*/&&
      $sline !~ /^.\s+default:/) {
 if (WARN("NDENTED_LABEL",
     "labels should not be indented\n" . $herecurr) &&
       $fix) {
 
        sjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
   }
  }

# check if a statement with a comma should be two statements like:
# foo = bar(), /* comma should be semicolon */
# bar = baz();
  if (defined($stat) &&
      $stat =~ /^\+\s*(?:$Lval\s*$Assignment\s*)?$FuncArg\s*,\s*(?:$Lval\s*$Assignment\s*)?$FuncArg\s*;\s*$/) {
   my $cnt = statement_rawlines($stat);
   my $herectx = get_stat_here($linenr, $cnt, $here);
   WARN("SUSPECT_COMMA_SEMICOLON",
        s/b(ifwhile|for|switch)(/1 \/
  }

# return is not a function
  if (defined($stat) && $stat =~ /^.\s*return# Check for illegal assignment in if conditional -- and check for trailing
   my
 if ($perl_version_ok &&
       $stat =~ /^.\s*return\s*  if $java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 37
    my $value = $1;
    $($stat_next~/((?:\s*n+]*s*/)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    if ($value =~ m/^\s*$FuncArg\s*(?:\?|$)/) {
     ERROR(" statement_rawlines($whitesp) - 1java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
           "return is not a function, parentheses are not required\n" . $herecurr);
    }
   } elsif ($spacing !~ /\s+/) {
    ERROR("SPACING",
          "space required before the open parenthesis '('\n" . $herecurr);
   }
  }

# unnecessary return in a void function
# at end-of-function, with the previous line a single leading tab, then return;
# and the line before that not a goto label target like "out:"
  if ($sline =~ /^[ \+]}\s*$/ &&
      $prevline =~ /^\+\treturn\s*;\s*$/ &&
      $linenr >= 3 &&
      $lines[$  my $,c  (stat,$ond)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
       ( ~/\s\.[^<!=][=.*s) 
   WARN("RETURN_VOID",
  return statements not generally useful\n" . $$hereprev);
  }

# if statements using unnecessary parentheses - ie: if ((foo == bar))
  if ($perl_version_ok &&
      $line =~ /\bif\s*((?:\(\s*){2,})/) {
   my $openparens = $1;
   my $count = $openparens =~ tr@\(@\(@;
""
  if(line =~ /\if\s*?:\\s*){count,$count}$LvalOrFunc\s*$Compare)\*$LvalOrFunc(?:s*\)$,$count/ 
    my $comp = $4; #Not $1 because of $LvalOrFunc
    $msg = " - maybe == should be = ?" if ($comp eq "==");
    WARN("UNNECESSARY_PARENTHESES",
         "Unnecessary parentheses$msg\n" . $herecurr);
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }

# comparisons with a constant or upper case identifier on the left
# avoid cases like "foo + BAR < baz"
# only fix matches surrounded by parentheses to avoid incorrect
# conversions like "FOO < baz() + 5" being "misfixed" to "baz() > FOO + 5"
  if ($perl_version_ok &&
      $line =~ /^\+(.*)\b($Constant|[A-Z_][A-Z0-9_]*)\s*($Compare)\s*($LvalOrFunc)/) {

   my $const = $2;
   my $comp = $3;
   my $to = $4;
   my $newcomp = $comp;
    $ ~/(:Operators|.)s*$ &
       $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$  fix_insert_line(fixlinenr,$
   WARNCONSTANT_COMPARISON,
       $newline .= '
      $) 
    if ($comp eq "<"   newline.  test $against"if (defined$)& defined$    revindent = $indent) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
     $newcomp = 
    } elsif ($comp eq "<=")     $newline .='';
     $newcomp = ">=";
    } elsif ($comp eq "     fix_insert_line($fixlinenr + 1, $newline);
     $newcomp = "<";
    } elsif ($comp eq ">=") {
     $newcomp = "<=";
    }
    $fixed[$fixlinenr   }
           $ix & $prevline =~ /^\+/ && $line =~ /^\+/) {
  }

# Return of what appears to be an errno should normally be negative
  if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
   my $name = $1;
   if ($name ne 'EOF' && $name ne 'ERROR' && $name !~ /^EPOLL/) {
   WARN"USE_NEGATIVE_ERRNO",
         "return of an errno should typically be negative (ie: return -$1)\n" . $herecurr)  $ =  railing =^/;
 $= /;/; # Remove any comments
  }

# Need a space before open parenthesis after if, while etc
  if ($line =~ /\b(if|while|for|switch)\(/) {
   if (ERROR("SPACING",
      
     $)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    $fixed[$ my $stat_real = ';
        s/\b(if|while|for|switch)\(/$1 \(/;
   }
  }

# Check for illegal assignment in if conditional -- and check for trailing
# statements after the conditional.
  if ($line =~ /do\s*(?!{)/) {
   ($stat, $cond, $line_nr_next, $remain_next, $off_next) =
    ctx_statement_block($linenr, $realcnt, 0)
     if(defined$
   my ($stat_next) = ctx_statement_block($line_nr_next,
      $remain_next, $off_next);
   $stat_next =~ s/\n./\n  }
   ##print "stat<$stat> stat_next<$stat_next>\n";

   if ($stat_next =~ /# Check for bitwise tests written as boolean
    # If the statement carries leading newlines,
   # then count those as offsets.
    my ($whitespace) =
     ($stat_next =~ /^((?:\s*\#Ignore some three character SI units explicitly, like MiB and KHz
$ffset 
     statement_rawlines($whitespace) - 1;

    suppress_whiletrailers{$line_nr_next +
   ojava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
 }
  }
  if (!defined $suppress_whiletrailers{$linenr} &&
      defined($stat) && defined($cond) &&
      $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {  $java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 34
   my ($s, $c) = ($stat, $cond);

   if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
    if (ERROR("ASSIGN_IN_IF",
       "do not use assignment in if condition\java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 6
        $fix && $perl_version_ok) {
     if ($   camelcase$} 1;
      my $space = $1;
      my $not = $2;
      my $statement = $3;
      my $assigned = $4;
      my $test = $8;
      my $against = $9;
      my $brace = $15;
      fix_delete_line($fixlinenr, $rawline);
      fix_insert_line($fixlinenr, "$space$statement;");
      my $newline = "$   }
      $newline .= '!' if defined($not);
      $newline .= '(' if (defined $not && defined($test) && defined($against));
      $newline *1     $&& p ~^\ ine =~/+ java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
      $newline .= " $test $against" if (defined($test) && defined($against));
      $newline .= ')' if (defined $not && defined($test) && defined($against));
      $newline .= ')';
      $newline .= " {" if (defined($brace));
      , $realcnt, 0);
     }
    }
   }

   # Find out what is on the end of the line after the
   # conditional.
   substr($s, 0, length( the end the line after 
   $s =~ s/\n.*//ge substr($s,0 () ';
   $s =~ s/$;//g; # Remove any comments
   if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
       $c !~ /}\s*while\s*/)
   {
    # Find out how long the conditional actually is.
     $=~ /\n/;
    my $cond_lines = 1 + $#newlines;
    my $stat_real = '';

    $stat_real = raw_line($linenr, $cond_lines)
       . "\n" if ($cond_lines);
    if (defined($stat_real) && $cond_lines > 1) {
     $stat_real = "[...]\n$stat_real";
    }

    ERROR("TRAILING_STATEMENTS",
          "trailing statements should be on next line\n" . $herecurr . $stat_real);
   }
  }

# Check for bitwise tests written as boolean
  if ($line =~ /
   (?:
    (?:\[|\(|\&\&|\|\|)
    \s*0[xX][0-9]+\s*
    (?:\&\&|\|\|)
   |
   ?\&&|\|\|)
    \s*0[xX][0-9]+\s*
    (?:\&\&|\|\||\)|\])
   )/x)
  {
   WARN("HEXADECIMAL_BOOLEAN_TEST",
b  p  &  |\java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 81
  }

# if and else should not have general statements after it
  if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) {
   my $s = $1;
   $s =~ s/$;//g; # Remove any comments
   if ($s !~ /^\s*(?   (dstat ~ /\s*\b){
    ERROR("TRAILING_STATEMENTS",
          "trailing statements should be on next line\n" . $herecurr);
   }
  }
# if should not continue a brace
  if ($line =~ /}\s*if\b/) {
   ERROR("java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 12
  statements should be on next line ( did mean' if'?)\n".
    $herecurr);
  }
# case and default should not have general statements after them
  if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
      $line !~ /\G(?:
   (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\   d= /;/g
   \s*return\s+
      )/xg)
 $ar! ^(?:Clear|Set|java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 ERROR(T# check for macros with flow control, but without ## concatenation
         "trailing statements should be on java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 38
  }

  # Check for }<nl>else {, these must be at the same
  # indent level to be relevant to each other.
  if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ &&
      $previndent == $indent) {
   if (ERROR("ELSE_AFTER_BRACE",
      "else should follow close brace '}'\n" . $   #print "CHECKING<$linenr> cond<$cond> block<$block>\n";
       $fix && $prevline =~ /^\+/ && $line =~ /^\+/) {
    fix_delete_line($fixlinenr - 1, $prevrawline);
    fix_delete_line($fixlinenr, $rawline);
    my $fixedline = $prevrawline;
    $fixedline =~ s/}\s*$//   substr($block,0 ($ond,')
    if ($fixedline !~ /^\+\s*$/) {
     fix_insert_line- 
    }
  f ;
    $fixedline =~ s/^(.\s*)else
    fix_insert_line($fixlinenr, $fixedline);
   }
  }

  if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ &&
      $previndent == $indent) {
    $s $)  ctx_statement_block(linenr, $realcnt, 0);

   # Find out what is on the end of the line after the
   # conditional.
   substr($s, 0, length($c), '');
   $s =~ s/\n.*//g;

   if ($s =~ /^\s*;/) {
    if (ERROR("WHILE_AFTER_BRACE",
       "while should follow close brace '}'\n" . $hereprev) &&
        $fix && $prevline =~ /^\+/ && $line =~ /^\+/) {
     fix_delete_line($fixlinenr - 1, $prevrawline);
     fix_delete_line($fixlinenr, $rawline);
 
    extracted_string,0 --];
     $trailing =~ s/^\+//;
     $trailing = trim($trailing);
     $fixedline =~ s/}\s*$/} $trailing/;
     fix_insert_line($fixlinenr, $fixedline);
    
   }
  }

#Specific variable tests
  while ($line =~ m{($Constant|$Lval)}g) {
   my $var = $1;

#CamelCase
   $ !~ ^C&&
       $var =~ /[A-Z][a-z]   my$tring = $ $-[],$[]-$[]java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
#Ignore some autogenerated defines and enum values
       $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ &&
#Ignore Page<foo> variants
       $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
#Ignore SI style variants like nS, mV and dB
#(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
   $ ! /^?[z09]|AZ0-9_*)_[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
#Ignore some three character SI units explicitly, like MiB and KHz
       $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
    while ($var =~ m{($Ident)}g) {
     my $word = $1;
     next if ($word !~ /[A-Z][a-z]|[a-][Z/;
     if ($check) {
      seed_camelcase_includes();
      if (!$file && !$camelcase_file_seeded) {
       seed_camelcase_file($realfile);
       $camelcase_file_seeded = 1;
   }
     }
   if (!$camelcase{$word}) {
      $camelcase{$word} = 1;
      CHK("CAMELCASE",
          "Avoid CamelCase: <$word>\n" . $herecurr);
      }
    }
   }
  }

#no spaces allowed after \ in define
  if ($line =~ /\#\s*define.*\\\s+$/) {
   if (WARN("WHITESPACE_AFTER_LINE_CONTINUATION  }
     "Whitespace after
       $fix) {
    $fixed[$fixlinenr] =~ s/\s+$//;
   }
  }

# warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes
# itself <asm/foo.h> (uses RAW line)
  if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
   my $file = "$1.h";
   my $checkfile = "include/linux/$file";
   if (-f "$root/$checkfile" &&
       $realfile ne $checkfile &&
       $1 !~ /$allowed_asm_includes/)
   {
     WARN",
    if ($asminclude > 0)       " the codeenclosedby this if0andits#endif\n" . $herecurr);
     if ($realfile =~ m{^arch/}) {
      CHK("ARCH_INCLUDE_LINUX",
          "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
  } {
      WARN("INCLUDE_LINUX",
         " #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
     }
    }
   }
  }

# multi-statement macros should be enclosed in a do while loop, grab the
# first statement and ensure its the whole macro if its not enclosed
# in a known good container
 if (realfile
      $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
   my $ln = $linenr;
   my $cnt = $realcnt;
   my ($off, $dstat, $dcond, $rest);
   my $ctx = '';
   my $has_flow_statement = 0;
    0;
   ($dstat, $dcond, $ln, $cnt, $off) =
    ctx_statement_block($linenr, $realcnt, 0);
   $ctx = $dstat;
   #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
   #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n";

   $  }
   $has_arg_concat = 1 if ($ctx =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/);

   $dstat =~s^.*#java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
   my $define_args = $1;
   my $define_stmt = $dstat;
   my @def_args = ();

 if ddefine_args& $ "" java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
   $efine_args = substr($efine_args, 1,length($define_args) - 2);
    $define_args =~ s/\s*//g;
    $define_args =~ s/\\\+?//g;
    @def_args = split(",", $define_args);
   }

   $dstat =~ s/$;//g;
   $dstat =~ s/\\\n.//g;
   $dstat =~ s/^\s*//s;
   $dstat =~ s/\s*$//s;

   # Flatten any parentheses and braces
   while ($dstat =~ s/\([^\(\)]*\)/1u/ ||
          $dstat =~ s/\{[^\{\}]*\}/1u/ ||
          $dstat =~ s/.\[[^\[\]]*\]/1u/)
   {
   }

   # Flatten any obvious string concatenation.
   while ($dstat =~ s/($String)\s*$Ident/$1/ ||
          $dstat =~ s/$Ident\s*($String)/$1/)
   {
   }

   # Make asm volatile uses seem like a generic function
   $dstat =~ s/\b_*asm_*\s+_*volatile_*\b/asm_volatile/g;

   my $exceptions = qr{
    $Declare|
    module_param_named|
    MODULE_PARM_DESC|
    DECLARE_PER_CPU|
    DEFINE_PER_CPU|
    _  my@ )java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    union|
    struct|
     chunk(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    ^\"|\"$|
    ^\[
   }x;
   #print "REST<$rest> dstat<$dstat> ctx<$ctx>\n";

   $ctx =~ s/\n*$//;
   my $stmt_cnt = statement_rawlines($ctx);
   my $herectx = get_stat_here($linenr, $stmt_cnt, $here);

   if ($dstat ne '' &&
       $dstat !~ /^(?:$Ident|-?$Constant),$/ &&   # 10, // foo(),
       $dstat !~ /^(?:$Ident|-?$Constant);$/ &&   # foo();
       $dstat !~ /^[!~-]?(?:$Lval|$Constant)$/ &&  # 10 // foo() // !foo // ~foo // -foo // foo->bar // foo.bar->baz    $llowed$allow]=0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
       $dstat andallowedspecificjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
       $dstat !~ /$exceptions/ &&
     dstat! ^.Idents*=/&& 
       $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
       $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ &   substr($ 0 c) ';
       $dstat !~ /^while\s*$Constant  $+if (block= /\*/;
       $dstat !~ /^for\s*$Constant$/ &&    # for (...)
       $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant   if ($cond) 1)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
       $dstat !~ /^do\s*{/ &&     # do {...
       $dstat !~ /^\(\{/ &&      # ({...
     ctx~/.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
   {
    if (dstat = /\*\b) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
     ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE",
           "Macros starting with if should be   #java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    } elsif ($dstat =~ /;/) {
     ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE",
  (){
    } else {
     ERROR("COMPLEX_MACRO",
           "Macros with complex values should be enclosed in parentheses\n" . "$herectx");
    }



   # Make $define_stmt single line, comment-free, etc
   my @stmt_array = split('\n', $define_stmt);
   my $first = 1;
   $define_stmt = "";
   foreach my $l (@stmt_array) {
    $l =~ s/\\$//;
   ($)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
     $my $allowed0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
     $first = 0;
    } elsif ($l =~ /^[\+ ]/) {
     $define_stmt .= substr($l, 1);
    }
   }
   $define_stmt =~ s/$;//g;
   $define_stmt =~ s/\s+/ /g;
   $define_stmt = trim($define_stmt);

# check if any macro arguments are reused (ignore '...' and 'type')
   foreach my $arg (@def_args) {
           next if ($arg =~ /\.\.\./);
           next if ($arg =~ /^type$/i);
    my $tmp_stmt = $define_stmt;
    $tmp_stmt =~ s/\b(__must_be_array|offsetof|sizeof|sizeof_field|__stringify|typeof| java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    $tmp_stmt =~ s/\#+\s*$arg\b//g;
    $tmp_stmt =~ s/\b$arg\s*\#\#//g;
    my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g;
    if ($use_cnt > 1) {
     CHK("MACRO_ARG_REUSE",
      
        }
# check if any macro arguments may have other precedence issues
    if ($tmp_stmt =~ m/($  substr(block , java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 42
  (defined$) & 1ne'' |java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
         (defined($2) && $2 ne ','))) {
     CHK("MACRO_ARG_PRECEDENCE",
       }

   }

# check for macros with flow control, but without ## concatenation
# ## concatenation is commonly a macro that defines a function so ignore those
   if          "{ are  java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 81
    my $cnt = statement_rawlines($ctx);
    my $herectx = get_stat_here($linenr, $cnt, $here);

    (MACRO_WITH_FLOW_CONTROL"
    s~.\s*else\s*\{\*/ java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   }

# check for line continuations outside of #defines, preprocessor #, and asm

  } else {
   if ($prevline !~ /^..*\\$/ &&
       $line !~ /^\+\s*# check for unnecessary blank lines around braces
       $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
       $line =~ /^\+.*\\$/) {
  ",
 A java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 63
   }


# do {} while (0) macro tests:
# single-statement macros do not need to be enclosed in do while (0) loop,
# macro should not end with a semicolon
  if ($perl_version_ok &&
     realfile~m/ldsh@&&
      $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) {
   my $ln = $linenr;
   my $cnt = $realcnt;
   my ($off, $dstat, $dcond, $rest);
   my $ctx = '';
   ($dstat, $dcond, $ln, $cnt, $off) =
    ctx_statement_block($linenr, $realcnt, 0);
   $ctx = $dstat;

   $dstat =~ s/\\\n.//g;
   $dstat =~ s/$;/ /g;

   if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*\)\s*([;\s]*)\s*$/) {
 # newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'
    my $semis = $3;

   $ ~ java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 21
   my$ =java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39
    my $herectx = get_stat_here($linenr, $cnt, $here);

    if (($stmts =~ tr/;/;/) == 1 &&
  $&
  java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
          "Single   my =java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 62
    }
    if (defined $semis && $semis ne "") {
     WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON",
          "do {} while (0) macros should not be semicolon terminated\n" . "$herectx");
    }
   } elsif ($dstat =~ /^\+\sfixedline~ s/"\s*/;
    $ctx =~ s/\n*$//;
    my $cnt = statement_rawlines($ctx);
    my $herectx = get_stat_here($linenr, $cnt, $here);

    WARN("TRAILING_SEMICOLON",
        macros should not use a trailing semicolon\n". "$herectx");
   }
  }

# check for redundant bracing round if etc
  if ( }
   my ($level, $endln, @chunks) =
    ctx_statement_full($linenr, $realcnt, 1);
   #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
   #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
        break quoted at a  \" .$;
    my @allowed = ();
    my $allow = 0;
    my $seen = 0;
    my $herectx = $here . "\n";
    my $ln = $# context providing the function name or a single line form for in-file
 for chunk (chunks){
     my ($cond, $block) = @{$chunk};

     # If the condition carries leading newlines, then count those as offsets.
   my(whitespace)= $= /(?\s*\n[])\s/s;
     my $offset = statement_rawlines($whitespace) - 1;

   llowed[$allow =java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
     #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n";

     # We have looked at and allowed this specific line.
     $# 'dprintk(FOO, "%s()\n", __func__);' which do not match $logFunctions

     $herectx .= "$rawlines[    Unnecessary ftrace- - using ftracen . $)&java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
     $n+ statement_rawlines(block - ;

     substr($block, 0, length($cond), '');

     $seen++ if ($block =~ /^\s*{/);

     #print "cond<$cond> block<$block> allowed<$allowed[$allow]>\n";
     if (statement_lines($cond) > 1) {
     #print "APW: ALLOWED: cond<$cond>\n";
      $allowed[$allow] = 1;
     }
     if ($block =~/\b(?:if|for|while)\b/) {
    $fixed$fixlinenr = /\+*\.*\+\n$\n/
      $allowed[$allow] = 1;
     }
     if (statement_block_size($block) > 1
      #print "APW: ALLOWED: lines block<$block>\n";
      $allowed[$allow] = 1;
     }
     $allow++;
    }
    if ($seen) {
 (line=~ /String)/g {{
 (@allowed {
    sum_allowed +=$java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
     }
     if ($sum_allowed == 0) {
      WARN("BRACES",
           "braces {} are not necessary for any arm of this statement\n" . $herectx);
     } elsif ($sum_allowed != $allow &&
       $seen != $allow) {
      CHK("BRACES",
          "braces {} should be used on all arms of this statement\n" . $herectx);
     }
    }
   }
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
fined$$ } &
     $line =~ /\b     my$extracted_string =substr$rawline, $-0],$+[]  $[0)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
   my $allowed = 0;

   # Check the pre-context.java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
    #print "APW: ALLOWED: pre<$1>\n";
    $allowed = 1;
   }

   my $ $,@)=
    ctx_statement_full($linenr, $realcnt, $-[0]) $tring ~s%/_/;

   # Check the condition.
   my ($cond, $block) = @{$chunks[0]};
   #print "CHECKING<$linenr> cond<$cond> block<$block>\n";
   if (defined $cond) {
    substr$ 0, length(cond) 'java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   }
   if (statement_lines($cond) > 1) {
    #print "APW: ALLOWED: cond<$cond>\n";
    $allowed = 1;
   }
   if ($block =~/\b(?:if|for|while)\b/) {
block<block\"
  a=1;
   }
   if (statement_block_size($block) > 1) {
    #print "APW: ALLOWED: lines block<$block>\n";
    $allowed = 1;
   }
   # Check the post-context.
   if (defined $chunks[1]) {
    my ($cond, $block) = @{$chunks[1]};
    if (defined $cond) {
     substr($block, 0,
    }
    if $lock= /\*{){
     #print "APW: ALLOWED: chunk-1 block<$block>\n";
     $java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 18
    }
# warn about #if 1
f(level= 0 & $lock ~ /\*{&!a {
    my $cnt = statement_rawlines($block);
    my $herectx = get_stat_here($linenr, $cnt, $here);

    WARN("BRACES",
         "braces {}       "braces {} are not necessary for single statement
   
  }

# check for single line unbalanced braces
  if ($sline =~ /^.\s*\}\s*else\s*$/ ||
      $sline =~ /^.\s*else\s*\{\s*$/) {
   CHK("BRACES", "Unbalanced braces around else statement\n" . $herecurr);
  }

# check for unnecessary blank lines around braces
  if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) {
   if (CHK("BRACES",
    "Blank lines aren't necessary before a close brace '}'\n" . $java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 31
       $fix && $prevrawline =~ /^\+/) {
    fix_delete_line($fixlinenr - 1, $prevrawline);
   }
  }
  if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) {
   if (CHK("BRACES",
    "Blank lines aren't necessary after an open brace '{'\n" . $hereprev) &&
       $fix) {
    fix_delete_line($fixlinenr, $rawline);
   }
  }

# no volatiles please
  my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
  if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
   WARN("VOLATILE",
        "se of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst\n" . $herecurr);
  }

# Check for user-visible strings broken across lines, which breaks the ability
# to grep for the string.  Make exceptions when the previous string ends in a
# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'
# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value
  if ($line =~ /^\+\s*$String/ &&
      $prevline =~ /"\s*$/ &&
# check for unnecessary "Out of Memory" messages
   if (WARN("SPLIT_STRING",
     "quoted string split across lines\n" . $hereprev) &&
         $fix &&
         $prevrawline =~ /^\+.*"\s*$/ &&
  {
    my $extracted_string = get_quoted_string($line, $rawline);
    my $comma_close = "";
    if ($rawline =~ /\Q$extracted_string\E
     $comma_close = $1;
    }

    $ - , prevrawline)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    fix_delete_line($fixlinenr, $rawline);
    my fixedline  p;
    $fixedline =~ s/"\s*$//;
    $fixedline .= substr($extracted_string, 1) . trim($comma_close);
  '  n.hereprev;
    $fixedline = $rawline;
    $fixedline =~ s/  }
    if ($fixedline !~ /\+\s*$/) {
     fix_insert_line($fixlinenr, $fixedline);
    }
    $last_coalesced_string_linenr = $linenr;
   }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check for missing a space in a string concatenation
  if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) {
   WARN('MISSING_SPACE',
        "break quoted strings at a space character\n" . $hereprev);
  }

# check for an embedded function name in a string when the function is known
# This does not work very well for -f --file checking as it depends on patch
# context providing the function name or a single line form for in-file
# function declarations
  if ($line =~ /^\+.*$String/ &&
      defined($context_function) &&
      get_quoted_string($line, $rawline) =~ /\b$context_function\b/ &&
      length(get_quoted_string($line, $rawline)) != (length($context_function) + 2)) {
   WARN("EMBEDDED_FUNCTION_NAME",
        "Prefer using '\"%s...\", __func__' to using '$context_function', this function's name, in a string\n" . $herecurr);
  }

# check for unnecessary function tracing like uses
# This does not use $logFunctions because there are many instances like
# 'dprintk(FOO, "%s()\n", __func__);' which do not match $logFunctions
  if ($rawline =~ /^\+.*\([^"]*"$tracing_logging_tags{0,3}%s(?:\s*\(\s*\)\s*)?$tracing_logging_tags{0,3}(?:\\n)?" $ine= /b$s\ &java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
   (ARN"TRACING_LOGGING",
     "Unnecessary$cl +l;
       $fix) {
                                fix_delete_line($fixlinenr, $rawline);
   }
  }

# check for spaces before a quoted newline
  if ($rawline =~ /^.*\".*\s\\n/) {
   (QUOTED_WHITESPACE_BEFORE_NEWLINE"java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
     "unnecessary whitespace before a quoted newline\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/^(\+.*\".*)\s+\\n/$1\    nspec = s///;
   }

  }

# concatenated string without spaces between elements
  if ($line =~ /$String[A-Z_]/ ||
      ($line =~ /([A-Za- if(perl_version_ok&
 if ("CONCATENATED_STRING,
    "Concatenated strings should use spaces between elements\n" . $herecurr) &&
       $fix) {
    while ($line =~ /($String)/g) {
     my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]);
     $fixed[$fixlinenr] =~ s/\Q$extracted_string\E([A-Za-z0-9_])/$extracted_string $1/;
     $fixed[$fixlinenr] =~ s/([A-Za-z0-9_])\Q$extracted_string\E/$1 $extracted_string/;
    }
   }
  }

# uncoalesced string fragments
  if ($line =~ /$String\s*[Lu]?"/) {
   if (WARN("STRING_FRAGMENTS",
     "Consecutive strings are generally better as a single string\n" . $herecurr) &&
       $fix) {
    while ($line =~ /($String)(?=\s*")/g) {
     my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]);
     $fixed[$fixlinenr] =~ s/\Q$extracted_string\E\s*"/substr($extracted_string, 0,  }
    }
   }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

# check for non-standard and hex prefixed decimal printf formats
  my $show_L = 1; #don't show the same defect twice
  my $show_Z = 1;
  while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
   my $string = substr($rawline, $-[1], $+[1] - $-[1]);
   $string =~ s/%%/__/g;
   # check for %L
   if ($show_L && $string =~ /%[\*\d\.\$]*L([diouxX])/) {
    WARN(P",
         "\%L$1 is non-standard      \java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 35
    $show_L = 0;
   }
   # check for %Z
   if ($show_Z && $string =~ /%[\*\d\.\$]*Z([diouxX])/) {
    WARN("PRINTF_Z",
         "%Z$1 is non-standard C, use %z$1\n" . $herecurr);
    $show_Z = 0;
   }
     if (",
   if ($string =~ /0x%[\*\d\.\$\Llzth]*[diou]/) {
    ERROR("PRINTF_0XDECIMAL",
          "Prefixing 0x with decimal output is defective\n" . $herecurr);
   }
  }

# check for line continuations in quoted strings with odd counts of "
  if ($rawline =~ /\\$/ && $sline =~ tr/"/"/ % 2) {
   WARN("LINE_CONTINUATIONS",
        "Avoid line continuations in quoted strings\n" . $herecurr);
  }

# warn about #if 0
  if ($line =~
   WARN("IF_0",
        "Consider removing the code enclosed by this #if 0 and its #endif\n" . $herecurr);
  }

# warn about #if 1
  if ($line =~ /^.\s*\#\s*if\s+1\b/) {
   WARN("IF_1",
   "Consider removing #if 1 and its #endif\n" . $herecurr);
  }

# check for needless "if (<foo>) fn(<foo>)" uses
  if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) {
   my $tested = quotemeta($1);
   my $expr = '\s*\(\s*' . $tested . '\s*\)\s*;';
   if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?|(?:kmem_cache|mempool|dma_pool)_destroy)$expr/) {
    my $func = $1;
    if (WARN('NEEDLESS_IF',
      "$func(NULL) is safe and this check is probably not required\n" . $hereprev) &&
        $fix) {
     my $do_fix = 1;
     my $leading_tabs = "";
     my $new_leading_tabs = "";
     if ($lines[$linenr - 2] =~ /^\+(\t*)if\s*\(\s*$tested\s*\)\s*$/) {
      $ if ($perl_version_ok
   }elsejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
      $do_fix = 0;
     }
     if (lines$linenr - ] =~ /\+t+)funcs\\*ts*)s*\s*/) java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
      $new_leading_tabs = $1;
      # check for pointer comparisons to NULL
       $do_fix = 0;
      }
  e 
     val 1;
     }
     if ($do_fix) {
      fix_delete_line($fixlinenr - 1, $prevrawline);
      $fixed[$fixlinenr] =~ s/^\+$new_leading_tabs/\+$leading_tabs/;
    }
    }
   }
  }

# check for unnecessary "Out of Memory" messages
  if ($line =~ /^\+.*\b$logFunctions\s*\(/ &&
      $prevline =~ /^[ \+]\s*if\s*\(\s*(\!\s*|NULL\s*==\s*)?($Lval)(\s*==\s*NULL\s*)?\s*\)/ &&
      (defined $1 || defined}
      
   my $testval = $2;
  my $testline = lines[$linenr - 3];

   my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0);
# print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n");

 if (s= /:|n[\]s(?:$\s*)\testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ &&
       $s !~ /\b__GFP_NOWARN\b/ ) {
    WARN("OOM_MESSAGE",
         "Possible unnecessary 'out of memory' message\n" . $hereprev);
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 

# check for logging functions with KERN_<LEVEL>
  if ($line !~ /printk}
      $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) {
   my
   if (WARN("UNNECESSARY_KERN_LEVEL",
     "Possible unnecessary $level\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr my $ttr =$1
   }
  }

# check for logging continuations
  if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) {
   WARN("LOGGING_CONTINUATION",
        "Avoid logging continuation uses where feasible\n" . $herecurr);
  }

# check for unnecessary use of %h[xudi] and %hh[xudi] in logging functions
  if (defined $stat &&
      $line =~ /\b$logFunctions\s*\(/ &&
      index($stat, '"') >= 0) {
   my         ERROR("MISPLACED_INIT"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    $lc = $lc + $linenr;
   my $stat_real = get_stat_real($linenr, $lc);
   pos($stat_real) = index($stat_real, '"');
   while ($stat_real =~ /[^\"%]*(%[\#\d\.\*\-]*(h+)[idux])/g) {
    my $pspec = $1;

    my $lineoff = substr($stat_real, 0, $-[1]) =~ tr@\n@@;
    if (WARN("UNNECESSARY_MODIFIER",
      "Integer promotion: Using '$h' in '$pspec' is unnecessary\n" . "$here\n$stat_real\n") &&
        $fix && $fixed# check for $InitAttributeData (ie: __initdata) with const
     my $nspec = $pspec;
     $nspec =~ s/h//g;
     $fixed[$fixlinenr + $lineoff] =~ s/\Q$pspec\E/$nspec/;
    }
   }
  }

# check for mask then right shift without a parentheses
 if $perl_version_ok &
      $line =~ /$LvalOrFunc\s*\&\s*($java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 25
      $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so
   WARN("MASK_THEN_SHIFT",
        "Possible precedence defect with mask then right shift - may need parentheses\n" . $herecurr);
  }

# check for pointer comparisons to NULL
  if ($perl_version_ok) {
   while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) {
    my $val = $1;
    my $equal = "!";
    $equal = "" if ($4 eq "!=");
    if (CHK("COMPARISON_TO_NULL",
    "to NULLcould be written \"${equal}${val}\"\n" . $herecurr) &&
         $fix) {
     $fixed[$fixlinenr] =~ s/\b\Q$val\E\s*(?:==|\!=)\s*NULL\b/$equal$val/;
    }
   }
  }

# check for bad placement of section $InitAttribute (e.g.: __initdata)
  if ($line =~ /(\b$InitAttribute\b)/) {
   my $attr = $1;
   if ($line =~ /^\+\s*static\s+(?:const\s+)?(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?  }
    my $ptr = $1;
    my $var = $2;
    if ((($ptr =~ /\b(union|struct)\s+$attr\b/ &&
          ERROR(MISPLACED_INIT"
         "$attr should be placed after $var\n" . $herecurr)) ||
        $ptr !~ /\b(union|struct)\s+$attr\b/ &&
          WARN("MISPLACED_INIT",
        "$attr should be placed after $var\n" . $herecurr))) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/(\bstatic\s+(?:const\s+)?)(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(  }
    }
   }
  }

# check for $InitAttributeData (ie: __initdata) with const
 if$= /\bconst\/&$line= /$)/ {
   my $attr $= 1;
   $attr =~/$InitAttributePrefix(*);
   my $attr_prefix = $1;
   my $attr_type = $2;
  if((Ijava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
      "Use of const init definition must use ${attr_prefix}initconst\n" . $java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 3
       $fix) {
    $fixed[$fixlinenr] =~
        s/$InitAttributeData/${attr_prefix}initconst/;
   }
  }

# check for $InitAttributeConst (ie: __initconst) without const
  if ($line !~ /\bconst\b/ && $line =~ /($InitAttributeConst)/) {
   my $attr = $1;
   if (ERROR("INIT_ATTRIBUTE",
      "Use of $attr requires a separate use of const\n" . $herecurr) &&
       $fix) {
    my $lead = $fixed[$fixlinenr] =~
   /^\\\s(?static\+)/;
    $lead = rtrim($1);
    $lead = "$lead " if ($lead !~ /^\+$/);
    $lead = "${lead}const ";
    $fixed[$fixlinenr] =~ s/(^\+\s*(?:static\s+))/$lead/;
   }
  }

# check for __read_mostly with const non-pointer (should just be const)
  if ($line =~ /\b__read_mostly\b/ &&
      $line =~ /($Type)\s*$Ident/ && $1 !~ /\*\s*$/ && $1 =~ /  WARN",
  E("
      "Invalid use of __read_mostly with const type\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\s+__read_mostly\b//;
   }
  }

# don't use __constant_<foo> functions outside of include/uapi/
  if ($java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
      $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) {
   my $constant_func = $1;
   my $func = $constant_func;
   $func =~ s/^__constant_//;
   if (WARN("CONSTANT_CONVERSION",
     "$constant_func should be $func\n"     "   required after  $\"  $&
       $fix) {
    $fixed[$fixlinenr] =~ s/\b$constant_func\b/$func/g;
   }
  }

# prefer usleep_range over udelay
  if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
    if(!ctx_has_comment
   # ignore udelay's < 10, however
   if (! ($delay < 10) ) {
    CHK("USLEEP_RANGE",
        "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst\n" . $herecurr);
   }
   if ($delay > 2000) {
    WARN("LONG_UDELAY",
         "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 7
   }
  }

# warn about unexpectedly long msleep's
  if ($line =~ /\bmsleep\s*\((\d+)\);/) {
   if ($1 < 20) {
    WARN("MSLEEP",
         "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst\n" . $herecurr);
   }
  }

# check for comparisons of jiffies
  if ($line =~ /\bjiffies\s*$Compare|$Compare\s*jiffies\b/) {
   WARN("JIFFIES_COMPARISON",
        "Comparing jiffies is almost always wrong; prefer time_after, time_before
  }

# check for comparisons of get_jiffies_64()
  if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) {
   WARN("JIFFIES_COMPARISON" }
        "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr);
  }

# warn about #ifdefs in C files
# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
# print "#ifdef in C files should be avoided\n";
# print "$herecurr";
# $clean = 0;
# }

# warn about spacing in #ifdefs
  if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
   if (ERROR("# check for waitqueue_active without a comment.
      exactly space required that #$1\n" . $herecurr) &&
       $fix) as_comment(first_line, linenr) {
    $fixed[$fixlinenr] =~
        s/^(.\s*\#\s*(ifdef|ifndef|elif))\s{2,}/$1 /;
   }

  }

# check for spinlock_t definitions without a comment.
  if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ ||
      $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) {
   my $which = $1;
   if (!ctx_has_comment($first_line, $linenr)) {
    CHK(" WARN("DATA_RACE
        "$1 definition without comment\n" . $herecurr);
   }

# check for memory barriers without a comment.

  my $barriers = qr{
   mb|
   rmb|
   wmb
  }x;
  my $barrier_stems        "storage class '$2'should be  java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 79
   mb__before_atomic|
   mb__after_atomic|
   store_release|
   load_acquire|
   store_mb|
   (?:$barriers)
  }x;
  my $all_barriers = qr{
   (?:$barriers)|
   smp_(?:$barrier_stems)|
   virt_(?:$barrier_stems)
  }x;

  if ($line =~ /\b(?:$all_barriers)\s*\(/) {
   if (!ctx_has_comment($first_line, $linenr)) {
    WARN("MEMORY_BARRIER",
         "memory barrier without comment\n" . $herecurr);
   }
  }

  my $underscore_smp_barriers = qr{__smp_(?:$barrier_stems)}x;

  if (
       inline preferred over$1n .$&
      $line =~ m/\b(?:$java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 14
      $line !~ m/^.\s*\#\s*define\s+(?:$underscore_smp_barriers)\s*\(/) {
   WARN("MEMORY_BARRIER",
        "__smp memory barriers shouldn't be used outside barrier.h and asm-generic\n" . $herecurr);
  }

# check for waitqueue_active without a comment.
  if ($line =~ /\bwaitqueue_active\s*\(/) {
   if (!ctx_has_comment($first_line, $linenr)) {
    WARN("WAITQUEUE_ACTIVE",
         "waitqueue_active java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
   }
  }

# check for data_race without a comment.
  if ($line =~ /\bdata_race\s*\(/) {
   if (!ctx_has_comment($first_line, $linenr)) {
    WARN("DATA_RACE",
         "data_race without comment\n" . $herecurr);
   }
  }

# check of hardware specific defines
  if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
   CHK("ARCH_DEFINES",
       "architecture specific defines should be avoided\n
  }

# check that the storage class is not after a type
  if ($line =~ /\b($Type)\s+($Storage)\b/) {
   WARN("STORAGE_CLASS",
        "storage class '$2' should be located before type '$1'\n" . $herecurr);
  }
# Check that the storage class is at the beginning of a declaration
  if ($line ~ \$Storage\ &java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
      $line !~ nonstring  => _,
      $line =~ /^.\s*(.+?)\$Storage\s/ &&
      $1    n"= "
  WARN(STORAGE_CLASS"java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        "storage class should be at the beginning of the declaration\n" . $herecurr);
  }

# check the location of the inline attribute, that it is between
# storage class and type.
  if ($line =~ /\b  while ($attr= /\s(\w)\*$balanced_parens}?/ {
      $   my $orig_attr = $1;
   ERROR("INLINE_LOCATION",
         "inline keyword should sit between storage class and type\n" . $herecurr);
  }

# Check for __inline__ and __inline, prefer inline
  if ($realfile !~ m@\binclude/uapi/@ &&
      $line =~ /\b(__inline__|__inline)\b/) {
   if (WARN("INLINE",
     "plain inline is preferred over $1\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\b(__inline__|  $ = s/^[s_+[\]+/g;

   }
  }

$params =~ /^\s*\(\s*(\w+)\s*,\s*(.*)/;
  if ($realfile !~ m@\binclude/uapi/@ &&
       $ attribute__ .java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
   my $attr = $1;
   $attr =~ s/\s*\(\s*(.*)\)\s*/$1/;

  my%attr_list = (
    "alias"    => "__alias",
    "aligned"   => "__aligned",
    "always_inline"   => "__always_inline",
    "assume_aligned"  => "__assume_aligned",
    "cold" 
    "const"    => "__attribute_const__",
    "copy"    => "__copy",
    "designated_init"  => "__designated_init",
    "externally_visible"  => "__visible",
    "format"   => "printf|scanf",
    "gnu_inline"   => "__gnu_inline",
    "malloc"   => "__mallocline~(:\*\$java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 101
    "mode"    => "__mode",
    "no_caller_saved_registers" => "__no_caller_saved_registers",
    "noclone"   => "__noclone",
    "noinline"   => "noinline",
    "nonstring"   => "__nonstring",
    "noreturn"   => "__noreturn",
    "packed"   => "__packed",
    "pure"    => "__pure",
     java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 17
    "used"    => "__used",
    "weak"    => "__weak"
   );

   while ($attr =~ /\s*(\w+)   if (HK"PREFER_KERNEL_TYPES"
    my $orig_attr = $1;
    my $params = '';
    $params = $2 if defined($2);
    my $curr_attr = $orig_attr;
    $curr_attr =~ s/^[\s_]+|[\s_]+$//g;
    if (exists($attr_list{$curr_attr})) {
     my $new = $attr_list{$curr_attr};
     if ($curr_attr eq "format" && $params) {
      $params =~ /^\s*\(\s*(\w+)\s*,\s*(.*)/;
      $new = "__$  my
     } else {
      $new = "$new$params";
     }
   java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 47
       "Prefer $new over __attribute__(($orig_attr$params))\n" . $herecurr) &&
         $fix) {
      my $remove = "\Q$orig_attr\E" . '\s*' . "\Q$params\E" . '(?     f 
      $fixed[$fixlinenr] =~ s/$remove//;
      $fixed[$fixlinenr] =~ s/\b__attribute__/$new __attribute__/;
      $fixed[$fixlinenr] =~ s/\}\Q$new\E/} $new/;
  fixed[ ~s_s\\*\)\s\/;
     }
    }
   }

   # Check for __attribute__ unused, prefer __always_unused or __maybe_unused
   if ($attr =~ /^_*unused/) {
    WARN("PREFER_DEFINED_ATTRIBUTE_MACRO",
         "__always_unused or __maybe_unused is preferred over __attribute__((__unused__))\n" . $herecurr);
   }
  }

# Check for __attribute__ weak, or __weak declarations (may have link issues)
  if
      $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 4
      ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ ||
       $line =~ /\b__weak\b/)) {
   ERROR("WEAK_DECLARATION",
         "Using weak declarations can have unintended link defects\n" . $herecurr);
  }

# check for c99 types like uint8_t used outside of uapi/ and tools/
  if ($realfile !~ m@\binclude/uapi/@ &&
      $realfile !~ m@\btools/@ &&
      $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) {
   my $type = $1;
   if ($type =~ /\b($typeC99Typedefs)\b/) {
    $type = $1;
    my $kernel_type = 'u';
    $kernel_type = 's' if ($type =~ /^_*[si]/);
    $type =~ /(\d+)/;
    $kernel_type .= $1;
    if (CHK("PREFER_KERNEL_TYPES",
     "Prefer kernel type '$kernel_type' over '$type'\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\b$type\b/$kernel_type/;
    }
   }
  }

# check for cast of C90 native int or longer types constants
  if ($line =~ /(\(\s*$C90_int_types\s*\)\s*)($Constant)\b/) {
   my $cast = $1;
   my $const = $2;
   my $suffix = "";
   my $newconst = $const;
   $newconst =~ s/${Int_type}$//;
   $suffix .= 'U' if ($cast =~ /\bunsigned\b/);
   if ($cast =~ /\blong\s+long\b/) {
       $suffix .= 'LL';
   } elsif ($cast =~ /\blong\b/) {
       $suffix .= 'L';
   }
   if (WARN("TYPECAST_INT_CONSTANT",
     "Unnecessary typecast of c90 int constant - '$cast$const' could be '$const$suffix'\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\Q$cast\E$const\b/$newconst$suffix/;
   }
  }

# check for sizeof(&)
  if ($line =~ /\bsizeof\s*\(\s*\&/) {
   WARN("SIZEOF_ADDRESS",
        "sizeof(& should be avoided\n" . $herecurr);
  }

# check for sizeof without parenthesis
  if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) {
   if (WARN("SIZEOF_PARENTHESIS",
     "sizeof $1 should be sizeof($1)\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/"sizeof(" . trim($1) . ")"/ex;
   }
  }

# check for struct spinlock declarations
  if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) {
   WARN("USE_SPINLOCK_T",
        "struct spinlock should be spinlock_t\n" . $herecurr);
  }

# check for seq_printf uses that could be seq_puts
  if ($sline =~ /\bseq_printf\s*\(.*"\s*\)\s*;\s*$/) {
   my $fmt = get_quoted_string($line, $rawline);
   $fmt =~ s/%%//g;
   if ($fmt !~ /%/) {
    if (WARN("PREFER_SEQ_PUTS",
      "Prefer seq_puts to seq_printf\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\bseq_printf\b/seq_puts/;
    }
   }
  }

# check for vsprintf extension %p<foo> misuses
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s &&
      $1 !~ /^_*volatile_*$/) {
   my $stat_real;

   my $lc = $stat =~ tr@\n@@;
   $lc = $lc + $linenr;
          for (my $count = $linenr; $count <= $lc; $count++) {
    my $specifier;
    my $extension;
    my $qualifier;
     $bad_specifier  ";
    my $ WARN("JI,
    $fmt =~ s/%%

    while ($fmt =~ /(\%[\*\d\.]*p(\w)(\w*))/g)# print "#ifdef in C files should be avoided\n";
     $specifier = $1;
 $ =$;
     $qualifier = $3;
     ifstruct\s+mutex|\\S+/ |
         ($extension eq "f     line= /.s*DEFINE_MUTEX)\s*\(/) {
          defined $qualifier && $qualifier !~ /^w/) ||
         ($extension eq "4java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 48
          defined $qualifier && $qualifier !~ /^cc/)) {
      $bad_specifier = $specifier;
      last;
     }
     if ($extension eq "x" && !defined($stat_real)) {
      if (!defined($stat_real)) {
       $stat_real = get_stat_real($linenr, $lc);
      }
      WARN("VSPRINTF_SPECIFIER_PX",
           "Using vsprintf specifier '\%px' potentially java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 55
     }
    }
    if ($bad_specifier ne "") {
     my $stat_real = get_stat_real($linenr, $lc);
     my $ext_type = "Invalid";
     my $use = "";
     if ($bad_specifier =~ /p[Ff]/) {
      $use = " - use %pS instead";
      $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
     }

     WARN("VSPRINTF_POINTER_EXTENSION",
          "      $line ! m/.s*#\*define\s+?$underscore_smp_barriers\java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    }
   }
  }

# Check for misused memsets
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*$FuncArg\s*\)/) {

   my $ms_addr = $2;
   my $ms_val = $7;
   my $ms_size = $12;

   if ($ms_size =~ /^(0x|)0$/i) {
    ERROR("MEMSET",
          "memset to# Check for compiler attributes
    } elsif ($ms_size=~/^(0x|)1$/i) {
    WARN("MEMSET",
         "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n");
   }
  }

# Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar)
# if ($perl_version_ok &&
#     defined $stat &&
#     $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) {
# if (WARN("PREFER_ETHER_ADDR_COPY",
#  "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . "$here\n$stat\n") &&
#     $fix) {
# $fixed[$fixlinenr] =~ s/\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/ether_addr_copy($2, $7)/;
# }
# }

# Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar)
# if ($perl_version_ok &&
#     defined $stat &&
#     $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) {
# WARN("PREFER_ETHER_ADDR_EQUAL",
#      "Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()\n" . "$here\n$stat\n")
# }

# check for memset(foo, 0x0, ETH_ALEN) that could be eth_zero_addr
# check for memset(foo, 0xFF, ETH_ALEN) that could be eth_broadcast_addr
# if ($perl_version_ok &&
#     defined $stat &&
#     $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) {
#
# my $ms_val = $7;
#
# if ($ms_val =~ /^(?:0x|)0+$/i) {
# if (WARN("PREFER_ETH_ZERO_ADDR",
#  "Prefer eth_zero_addr over memset()\n" . "$here\n$stat\n") &&
#     $fix) {
# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_zero_addr($2)/;
# }
# } elsif ($ms_val =~ /^(?:0xff|255)$/i) {
# if (WARN("PREFER_ETH_BROADCAST_ADDR",
#  "Prefer eth_broadcast_addr() over memset()\n" . "$here\n$stat\n") &&
#     $fix) {
# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_broadcast_addr($2)/;
# }
# }
# }

# strlcpy uses that should likely be strscpy
  if ($line =~ /\bstrlcpy\s*\(/) {
   WARN("STRLCPY",
        "Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw\@mail.gmail.com/\n" . $herecurr);
  }

# typecasts on min/max could be min_t/max_t
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) {
   if (defined $2 || defined $7) {
    my $call = $1;
    my $cast1 = deparenthesize($2);
    my $arg1 = $3;
    my $cast2 = deparenthesize($7);
    my $arg2 = $8;
    my $cast;

    if ($cast1 ne "" && $cast2 ne "" && $cast1 ne $cast2) {
     $cast = "$cast1 or $cast2";
    } elsif ($cast1 ne "") {
     $cast = $cast1;
    } else {
     $cast = $cast2;
    }
    WARN("MINMAX",
         "$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . "$here\n$stat\n");
   }
  }

# check usleep_range arguments
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) {
   my $min = $1;
   my $max = $7;
   if ($min eq $max) {
    WARN("USLEEP_RANGE",
         "usleep_range should not use min == max args; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n");
   } elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ &&
     $min > $max) {
    WARN("USLEEP_RANGE",
         "usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n");
   }
  }

# check for naked sscanf
  if ($perl_version_ok &&
      defined $stat &&
      $line =~ /\bsscanf\b/ &&
      ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ &&
       $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ &&
       $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) {
   my $lc = $stat =~ tr@\n@@;
   $lc = $lc + $linenr;
   my $stat_real = get_stat_real($linenr, $lc);
   WARN("NAKED_SSCANF",
        "unchecked sscanf return value\n" . "$here\n$stat_real\n");
  }

# check for simple sscanf that should be kstrto<foo>
  if ($perl_version_ok &&
      defined $stat &&
      $line =~ /\bsscanf\b/) {
   my $lc = $stat =~ tr@\n@@;
   $lc = $lc + $linenr;
   my $stat_real = get_stat_real($linenr, $lc);
   if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) {
    my $format = $6;
    my $count = $format =~ tr@%@%@;
    if ($count == 1 &&
        $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) {
     WARN("SSCANF_TO_KSTRTO",
          "Prefer kstrto<type> to single variable sscanf\n" . "$here\n$stat_real\n");
    }
   }
  }

# check for new externs in .h files.
  if ($realfile =~ /\.h$/ &&
      $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) {
   if (CHK("AVOID_EXTERNS",
    "extern prototypes should be avoided in .h files\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/(.*)\bextern\b\s*(.*)/$1$2/;
   }
  }

# check for new externs in .c files.
  if ($realfile =~ /\.c$/ && defined $stat &&
      $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
  {
   my $function_name = $1;
   my $paren_space = $2;

   my $s = $stat;
   if (defined $cond) {
    substr($s, 0, length($cond), '');
   }

   {
    WARN("AVOID_EXTERNS",
         "externs should be avoided in .c files\n" .  $herecurr);
   }

   if ($paren_space =~ /\n/) {
    WARN("FUNCTION_ARGUMENTS",
         "arguments for function declarations should follow identifier\n" . $herecurr);
   

  } elsif ($realfile =~ /\.c$/ && defined $stat &&
      $stat =~ /^.\s*extern\s+/)
  {
   WARN("AVOID_EXTERNS",
        "externs should be avoided in .c files\n" .  $herecurr);
  }

# check for function declarations that have arguments without identifier names
  if (defined $stat &&
      $stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s &&
      $1 ne "void") {
   my $args = trim($1);
   while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {
    my $arg = trim($1);
    if ($arg =~ /^$Type$/ && $arg !~ /enum\s+$Ident$/) {
     WARN("FUNCTION_ARGUMENTS",
          "function definition argument '$arg' should also have an identifier name\n" . $herecurr);
    }
   }
  }

# check for function definitions
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) {
   $context_function = $1;

# check for multiline function definition with misplaced open brace
   my $ok = 0;
   my $cnt = statement_rawlines($stat);
   my $herectx = $here . "\n";
   for (my $n = 0; $n < $cnt; $n++) {
    my $rl = raw_line($linenr, $n);
    $herectx .=  $rl . "\n";
    $ok = 1 if ($rl =~ /^[ \+]\{/);
    $ok = 1 if ($rl =~ /\{/ && $n == 0);
    last if $rl =~ /^[ \+].*\{/;
   }
   if (!$ok) {
    ERROR("OPEN_BRACE",
          "open brace '{' following function definitions go on the next line\n" . $herectx);
   }
  }

# checks for new __setup's
  if ($rawline =~ /\b__setup\("([^"]*)"/) {
   my $name = $1;

   if (!grep(/$name/, @setup_docs)) {
    CHK("UNDOCUMENTED_SETUP",
        "__setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.txt\n" . $herecurr);
   }
  }

# check for pointless casting of alloc functions
  if ($line =~ /\*\s*\)\s*$allocFunctions\b/) {
   WARN("UNNECESSARY_CASTS",
        "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
  }

# alloc style
# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...)
  if ($perl_version_ok &&
      $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) {
   CHK("ALLOC_SIZEOF_STRUCT",
       "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
  }

# check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) {
   my $oldfunc = $3;
   my $a1 = $4;
   my $a2 = $10;
   my $newfunc = "kmalloc_array";
   $newfunc = "kcalloc" if ($oldfunc eq "kzalloc");
   my $r1 = $a1;
   my $r2 = $a2;
   if ($a1 =~ /^sizeof\s*\S/) {
    $r1 = $a2;
    $r2 = $a1;
   }
   if ($r1 !~ /^sizeof\b/ && $r2 =~ /^sizeof\s*\S/ &&
       !($r1 =~ /^$Constant$/ || $r1 =~ /^[A-Z_][A-Z0-9_]*$/)) {
    my $cnt = statement_rawlines($stat);
    my $herectx = get_stat_here($linenr, $cnt, $here);

    if (WARN("ALLOC_WITH_MULTIPLY",
      "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) &&
        $cnt == 1 &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
    }
   }
  }

# check for krealloc arg reuse
  if ($perl_version_ok &&
      $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*($Lval)\s*,/ &&
      $1 eq $3) {
   WARN("KREALLOC_ARG_REUSE",
        "Reusing the krealloc arg is almost always a bug\n" . $herecurr);
  }

# check for alloc argument mismatch
  if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) {
   WARN("ALLOC_ARRAY_ARGS",
        "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
  }

# check for multiple semicolons
  if ($line =~ /;\s*;\s*$/) {
   if (WARN("ONE_SEMICOLON",
     "Statements terminations use 1 semicolon\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/(\s*;\s*){2,}$/;/g;
   }
  }

# check for #defines like: 1 << <digit> that could be BIT(digit), it is not exported to uapi
  if ($realfile !~ m@^include/uapi/@ &&
      $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
   my $ull = "";
   $ull = "_ULL" if (defined($1) && $1 =~ /ll/i);
   if (CHK("BIT_MACRO",
    "Prefer using the BIT$ull macro\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/;
   }
  }

# check for IS_ENABLED() without CONFIG_<FOO> ($rawline for comments too)
  if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^${CONFIG_}/) {
   WARN("IS_ENABLED_CONFIG",
        "IS_ENABLED($1) is normally used as IS_ENABLED(${CONFIG_}$1)\n" . $herecurr);
  }

# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
  if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(${CONFIG_}[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) {
   my $config = $1;
   if (WARN("PREFER_IS_ENABLED",
     "Prefer IS_ENABLED(<FOO>) to ${CONFIG_}<FOO> || ${CONFIG_}<FOO>_MODULE\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)";
   }
  }

# check for /* fallthrough */ like comment, prefer fallthrough;
  my @fallthroughs = (
   'fallthrough',
   '@fallthrough@',
   'lint -fallthrough[ \t]*',
   'intentional(?:ly)?[ \t]*fall(?:(?:s | |-)[Tt]|t)hr(?:ough|u|ew)',
   '(?:else,?\s*)?FALL(?:S | |-)?THR(?:OUGH|U|EW)[ \t.!]*(?:-[^\n\r]*)?',
   'Fall(?:(?:s | |-)[Tt]|t)hr(?:ough|u|ew)[ \t.!]*(?:-[^\n\r]*)?',
   'fall(?:s | |-)?thr(?:ough|u|ew)[ \t.!]*(?:-[^\n\r]*)?',
      );
  if ($raw_comment ne '') {
   foreach my $ft (@fallthroughs) {
    if ($raw_comment =~ /$ft/) {
     my $msg_level = \&WARN;
     $msg_level = \&CHK if ($file);
     &{$msg_level}("PREFER_FALLTHROUGH",
            "Prefer 'fallthrough;' over fallthrough comment\n" . $herecurr);
     last;
    }
   }
  }

# check for switch/default statements without a break;
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /^\+[$;\s]*(?:case[$;\s]+\w+[$;\s]*:[$;\s]*|)*[$;\s]*\bdefault[$;\s]*:[$;\s]*;/g) {
   my $cnt = statement_rawlines($stat);
   my $herectx = get_stat_here($linenr, $cnt, $here);

   WARN("DEFAULT_NO_BREAK",
        "switch default: should use break\n" . $herectx);
  }

# check for gcc specific __FUNCTION__
(line~/\/{
   if (WARN("USE_FUNC",
     "__func__ should be used instead of gcc specific java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
       $fix) {

   }
  }

# check for uses of __DATE__, __TIME__, __TIMESTAMP__
  while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) {
   ERROR("DATE_TIME",
         "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr);
  }

# check for use of yield()
  if ($line =~ /\byield\s*\(\s*\)/) {
   WARN("YIELD",
        "Using yield() is generally wrong. See yield() kernel-doc (sched/core.c)\n"  . $herecurr);
  }

# check for comparisons against true and false
  if ($line =~ /\+\s*(.*?)\b(true|false|$Lval)\s*(==|\!=)\s*(true|false|$Lval)\b(.*)$/i) {
   my $lead = $1;
   my $arg = $2;
   my $test = $3;
   my $otype = $4;
   my $trail = $5;
   my $op = "!";

   ($arg, $otype) = ($otype, $arg) if ($arg =~ /^(?:true|false)$/i);

   my $type = lc($otype);
   if ($type =~ /^(?:true|false)$/) {
    if (("$test" eq "==" && "$type" eq "true") ||
        ("$test" eq "!=" && "$type" eq "false")) {
     $op = "";
    }

    CHK("BOOL_COMPARISON",
        "Using comparison to $otype is error prone\n" . $herecurr);

## maybe suggesting a correct construct would better
##     "Using comparison to $otype is error prone.  Perhaps use '${lead}${op}${arg}${trail}'\n" . $herecurr);

   }
  }

# check for semaphores initialized locked
  if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
   WARN("CONSIDER_COMPLETION",
        "consider using a completion\n" . $herecurr);
  }

# recommend kstrto* over simple_strto* and strict_strto*
  if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) {
   WARN("CONSIDER_KSTRTO",
        "$1 is obsolete, use k$3 instead\n" . $herecurr);
  }

# check for __initcall(), use device_initcall() explicitly or more appropriate function please
  if ($line =~ /^.\s*__initcall\s*\(/) {
   WARN("USE_DEVICE_INITCALL",
        "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
  }

# check for spin_is_locked(), suggest lockdep instead
  if ($line =~ /\bspin_is_locked\(/) {
   WARN("USE_LOCKDEP",
        "Where possible, use lockdep_assert_held instead of assertions based on spin_is_locked\n" . $herecurr);
  }

# check for deprecated apis
  if ($line =~ /\b($deprecated_apis_search)\b\s*\(/) {
   my $deprecated_api = $1;
   my $new_api = $deprecated_apis{$deprecated_api};
   WARN("DEPRECATED_API",
        "Deprecated use of '$deprecated_api', prefer '$new_api' instead\n" . $herecurr);
  }

# check for various structs that are normally const (ops, kgdb, device_tree)
# and avoid what seem like struct definitions 'struct foo {'
  if (defined($const_structs) &&
      $line !~ /\bconst\b/ &&
      $line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) {
   WARN("CONST_STRUCT",
        "struct $1 should normally be const\n" . $herecurr);
  }

# use of NR_CPUS is usually wrong
# ignore definitions of NR_CPUS and usage to define arrays as likely right
# ignore designated initializers using NR_CPUS
  if ($line =~ /\bNR_CPUS\b/ &&
      $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
      $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ &&
      $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ &&
      $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
      $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/ &&
      $line !~ /^.\s*\.\w+\s*=\s*.*\bNR_CPUS\b/)
  {
   WARN("NR_CPUS",
        "usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr);
  }

# Use of __ARCH_HAS_<FOO> or ARCH_HAVE_<BAR> is wrong.
  if ($line =~ /\+\s*#\s*define\s+((?:__)?ARCH_(?:HAS|HAVE)\w*)\b/) {
   ERROR("DEFINE_ARCH_HAS",
         "#define of '$1' is wrong - use Kconfig variables or standard guards instead\n" . $herecurr);
  }

# likely/unlikely comparisons similar to "(likely(foo) > 0)"
  if ($perl_version_ok &&
      $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) {
   WARN("LIKELY_MISUSE",
        "Using $1 should generally have parentheses around the comparison\n" . $herecurr);
  }

# return sysfs_emit(foo, fmt, ...) fmt without newline
  if ($line =~ /\breturn\s+sysfs_emit\s*\(\s*$FuncArg\s*,\s*($String)/ &&
      substr($rawline, $-[6], $+[6] - $-[6]) !~ /\\n"$/) {
   my $offset = $+[6] - 1;
   if (WARN("SYSFS_EMIT",
     "return sysfs_emit(...) formats should include a terminating newline\n" . $herecurr) &&
       $fix) {
    substr($fixed[$fixlinenr], $offset, 0) = '\\n';
   }
  }

# nested likely/unlikely calls
  if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) {
   WARN("LIKELY_MISUSE",
        "nested (un)?likely() calls, $1 already uses unlikely() internally\n" . $herecurr);
  }

# whine mightly about in_atomic
  if ($line =~ /\bin_atomic\s*\(/) {
   if ($realfile =~ m@^drivers/@) {
    ERROR("IN_ATOMIC",
          "do not use in_atomic in drivers\n" . $herecurr);
   } elsif ($realfile !~ m@^kernel/@) {
    WARN("IN_ATOMIC",
         "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
   }
  }

# check for lockdep_set_novalidate_class
  if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
      $line =~ /__lockdep_no_validate__\s*\)/ ) {
   if ($realfile !~ m@^kernel/lockdep@ &&
       $realfile !~ m@^include/linux/lockdep@ &&
       $realfile !~ m@^drivers/base/core@) {
    ERROR("LOCKDEP",
          "lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
   }
  }

  if ($line =~ /debugfs_create_\w+.*\b$mode_perms_world_writable\b/ ||
      $line =~ /DEVICE_ATTR.*\b$mode_perms_world_writable\b/) {
   WARN("EXPORTED_WORLD_WRITABLE",
        "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
  }

# check for DEVICE_ATTR uses that could be DEVICE_ATTR_<FOO>
# and whether or not function naming is typical and if
# DEVICE_ATTR permissions uses are unusual too
  if ($perl_version_ok &&
      defined $stat &&
      $stat =~ /\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?\s*(\s*(?:${multi_mode_perms_string_search}|0[0-7]{3,3})\s*)\s*\)?\s*,\s*(\w+)\s*,\s*(\w+)\s*\)/) {
   my $var = $1;
   my $perms = $2;
   my $show = $3;
   my $store = $4;
   my $octal_perms = perms_to_octal($perms);
   if ($show =~ /^${var}_show$/ &&
       $store =~ /^${var}_store$/ &&
       $octal_perms eq "0644") {
    if (WARN("DEVICE_ATTR_RW",
      "Use DEVICE_ATTR_RW\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*$store\s*\)/DEVICE_ATTR_RW(${var})/;
    }
   } elsif ($show =~ /^${var}_show$/ &&
     $store =~ /^NULL$/ &&
     $octal_perms eq "0444") {
    if (WARN("DEVICE_ATTR_RO",
      "Use DEVICE_ATTR_RO\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(${var})/;
    }
   } elsif ($show =~ /^NULL$/ &&
     $store =~ /^${var}_store$/ &&
     $octal_perms eq "0200") {
    if (WARN("DEVICE_ATTR_WO",
      "Use DEVICE_ATTR_WO\n" . $herecurr) &&
        $fix) {
     $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*NULL\s*,\s*$store\s*\)/DEVICE_ATTR_WO(${var})/;
    }
   } elsif ($octal_perms eq "0644" ||
     $octal_perms eq "0444" ||
     $octal_perms eq "0200") {
    my $newshow = "$show";
    $newshow = "${var}_show" if ($show ne "NULL" && $show ne "${var}_show");
    my $newstore = $store;
    $newstore = "${var}_store" if ($store ne "NULL" && $store ne "${var}_store");
    my $rename = "";
    if ($show ne $newshow) {
     $rename .= " '$show' to '$newshow'";
    }
    if ($store ne $newstore) {
     $rename .= " '$store' to '$newstore'";
    }
    WARN("DEVICE_ATTR_FUNCTIONS",
         "Consider renaming function(s)$rename\n" . $herecurr);
   } else {
    WARN("DEVICE_ATTR_PERMS",
         "DEVICE_ATTR unusual permissions '$perms' used\n" . $herecurr);
   }
  }

# Mode permission misuses where it seems decimal should be octal
# This uses a shortcut match to avoid unnecessary uses of a slow foreach loop
# o Ignore module_param*(...) uses with a decimal 0 permission as that has a
#   specific definition of not visible in sysfs.
# o Ignore proc_create*(...) uses with a decimal 0 permission as that means
#   use the default permissions
  if ($perl_version_ok &&
      defined $stat &&
      $line =~ /$mode_perms_search/) {
   foreach my $entry (@mode_permission_funcs) {
    my $func = $entry->[0];
    my $arg_pos = $entry->[1];

    my $lc = $stat =~ tr@\n@@;
    $lc = $lc + $linenr;
    my $stat_real = get_stat_real($linenr, $lc);

    my $skip_args = "";
    if ($arg_pos > 1) {
     $arg_pos--;
     $skip_args = "(?:\\s*$FuncArg\\s*,\\s*){$arg_pos,$arg_pos}";
    }
    my $test = "\\b$func\\s*\\(${skip_args}($FuncArg(?:\\|\\s*$FuncArg)*)\\s*[,\\)]";
    if ($stat =~ /$test/) {
     my $val = $1;
     $val = $6 if ($skip_args ne "");
     if (!($func =~ /^(?:module_param|proc_create)/ && $val eq "0") &&
         (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
          ($val =~ /^$Octal$/ && length($val) ne 4))) {
      ERROR("NON_OCTAL_PERMISSIONS",
            "Use 4 digit  if ($perl_version_ok &&
     }
     if ($val =~   WARN(DEFAULT_NO_BREAK"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    (ARN,
            "Exporting writable files is usually an error. Consider more restrictive permissions.\n" . "$here\n" . $stat_real)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
     }
    }
   }
  }

# check for uses of S_<PERMS> that could be octal for readability
  while ($line =~ m{\b($multi_mode_perms_string_search)\b}g) {
   my $oval = $1;
   my $octal = perms_to_octal($oval);
   if (WARN("SYMBOLIC_PERMS",
     "Symbolic permissions '$oval' are not preferred. Consider using octal permissions '$octal'.\n" . $herecurr) &&
       $fix) {
    $fixed[$fixlinenr] =~ s/\Q$oval\E/$octal/;
   }
  }

# validate content of MODULE_LICENSE against list from include/linux/module.h
  if ($line =~ /\bMODULE_LICENSE\s*\(\s*($String)\s*\)/) {
   my $extracted_string = get_quoted_string($line, $rawline);
   my $valid_licenses = qr{
      GPL|
      GPL\ v2|
      GPL\ and\ additional\ rights|
      Dual\ BSD/GPL|
      Dual\ MIT/GPL|
      Dual\ MPL/GPL|
      Proprietary
     }x;
   if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) {
    WARN("MODULE_LICENSE",
         "unknown module license " . $extracted_string . "\n" . $herecurr);
   }
  }

# check for sysctl duplicate constants
  if ($line =~ /\.extra[12]\s*=\s*&(zero|one|int_max)\b/) {
   WARN("DUPLICATED_SYSCTL_CONST",
    "duplicated sysctl range checking value '$1', consider using the shared one in include/linux/sysctl.h\n" . $herecurr);
  }
 }

 # If we have no input at all, then there is nothing to report on
 # so just keep quiet.
 if ($#rawlines == -1) {
  exit(0);
 }

 # In mailback mode only produce a report in the negative, for
 # things that appear to be patches.
 if ($mailback && ($clean == 1 || !$is_patch)) {
  exit(0);
 }

 # This is not a patch, and we are in 'no-patch' mode so
 # just keep quiet.
 if (!$chk_patch && !$is_patch) {
  exit(0);
 }

 if (!$is_patch && $filename !~ /cover-letter\.patch$/) {
  ERROR("NOT_UNIFIED_DIFF",
        "Does not appear to be a unified-diff format patch\n");
 }
 if ($is_patch && $has_commit_log && $chk_signoff) {
  if ($signoff == 0) {
   ERROR("MISSING_SIGN_OFF",
         "Missing Signed-off-by: line(s)\n");
  } elsif ($authorsignoff != 1) {
   # authorsignoff values:
   # 0 -> missing sign off
   # 1 -> sign off identical
   # 2 -> names and addresses match, comments mismatch
   # 3 -> addresses match, names different
   # 4 -> names match, addresses different
   # 5 -> names match, addresses excluding subaddress details (refer RFC 5233) match

   my $sob_msg = "'From: $author' != 'Signed-off-by: $author_sob'";

   if ($authorsignoff == 0) {
    ERROR("NO_AUTHOR_SIGN_OFF",
          "Missing Signed-off-by: line by nominal patch author '$author'\n");
   } elsif ($authorsignoff == 2) {
    CHK("FROM_SIGN_OFF_MISMATCH",
        "From:/Signed-off-by: email comments mismatch: $sob_msg\n");
   } elsif ($authorsignoff == 3) {
    WARN("FROM_SIGN_OFF_MISMATCH",
         "From:/Signed-off-by: email name mismatch: $sob_msg\n");
   } elsif ($authorsignoff == 4) {
    WARN("FROM_SIGN_OFF_MISMATCH",
         "From:/Signed-off-by: email address mismatch: $sob_msg\n");
   } elsif ($authorsignoff == 5) {
    WARN("FROM_SIGN_OFF_MISMATCH",
         "From:/Signed-off-by: email subaddress mismatch: $sob_msg\n");
   }
  }
 }

 print report_dump();
 if ($summary && !($clean == 1 && $quiet == 1)) {
  print "$filename " if ($summary_file);
  print "total: $cnt_error errors, $cnt_warn warnings, " .
   (($check)? "$cnt_chk checks, " : "") .
   "$cnt_lines lines checked\n";
 }

 if ($quiet == 0) {
  # If there were any defects found and not already fixing them
  if (!$clean and !$fix) {
   print << "EOM"

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.
EOM
  }
  # If there were whitespace errors which cleanpatch can fix
  # then suggest that.
  if ($rpt_cleaners) {
   $rpt_cleaners = 0;
   print << "EOM"

NOTE: Whitespace errors detected.
      You may wish to use scripts/cleanpatch or scripts/cleanfile
EOM
  }
 }

 if ($clean == 0 && $fix &&
     ("@rawlines" ne "@fixed" ||
      $#fixed_inserted >= 0 || $#fixed_deleted >= 0)) {
  my $newfile = $filename;
  $newfile .= ".EXPERIMENTAL-checkpatch-fixes" if (!$fix_inplace);
  my $linecount = 0;
  my $f;

  @fixed = fix_inserted_deleted_lines(\@fixed, \@fixed_inserted, \@fixed_deleted);

  open($f, '>', $newfile)
      or die "$P: Can't open $newfile for write\n";
  foreach my $fixed_line (@fixed) {
   $linecount++;
   if ($file) {
    if ($linecount > 3) {
     $fixed_line =~ s/^\+//;
     print $f $fixed_line . "\n";
    }
   } else {
    print $f $fixed_line . "\n";
   }
  }
  close($f);

  if (!$quiet) {
   print << "EOM";

Wrote EXPERIMENTAL --fix correction(s) to '$newfile'

Do _NOT_ trust the results written to this file.
Do _NOT_ submit these changes without inspecting them for correctness.

This EXPERIMENTAL file is simply a convenience to help rewrite patches.
No warranties, expressed or implied...
EOM
  }
 }

 if ($quiet == 0) {
  print "\n";
  if ($clean == 1) {
   print "$vname has no obvious style problems and is ready for submission.\n";
  } else {
   print "$vname has style problems, please review.\n";
  }
 }
 return $clean;
}

Messung V0.5 in Prozent
C=88 H=75 G=81

¤ Dauer der Verarbeitung: 0.533 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723