diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 94371f69122c..bd6ac90d194c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -69,7 +69,9 @@ my $dbg_possible = 0; | |||
69 | my $dbg_type = 0; | 69 | my $dbg_type = 0; |
70 | my $dbg_attr = 0; | 70 | my $dbg_attr = 0; |
71 | for my $key (keys %debug) { | 71 | for my $key (keys %debug) { |
72 | eval "\${dbg_$key} = '$debug{$key}';" | 72 | ## no critic |
73 | eval "\${dbg_$key} = '$debug{$key}';"; | ||
74 | die "$@" if ($@); | ||
73 | } | 75 | } |
74 | 76 | ||
75 | if ($terse) { | 77 | if ($terse) { |
@@ -206,9 +208,9 @@ my @dep_includes = (); | |||
206 | my @dep_functions = (); | 208 | my @dep_functions = (); |
207 | my $removal = "Documentation/feature-removal-schedule.txt"; | 209 | my $removal = "Documentation/feature-removal-schedule.txt"; |
208 | if ($tree && -f "$root/$removal") { | 210 | if ($tree && -f "$root/$removal") { |
209 | open(REMOVE, "<$root/$removal") || | 211 | open(my $REMOVE, '<', "$root/$removal") || |
210 | die "$P: $removal: open failed - $!\n"; | 212 | die "$P: $removal: open failed - $!\n"; |
211 | while (<REMOVE>) { | 213 | while (<$REMOVE>) { |
212 | if (/^Check:\s+(.*\S)/) { | 214 | if (/^Check:\s+(.*\S)/) { |
213 | for my $entry (split(/[, ]+/, $1)) { | 215 | for my $entry (split(/[, ]+/, $1)) { |
214 | if ($entry =~ m@include/(.*)@) { | 216 | if ($entry =~ m@include/(.*)@) { |
@@ -220,17 +222,21 @@ if ($tree && -f "$root/$removal") { | |||
220 | } | 222 | } |
221 | } | 223 | } |
222 | } | 224 | } |
225 | close($REMOVE); | ||
223 | } | 226 | } |
224 | 227 | ||
225 | my @rawlines = (); | 228 | my @rawlines = (); |
226 | my @lines = (); | 229 | my @lines = (); |
227 | my $vname; | 230 | my $vname; |
228 | for my $filename (@ARGV) { | 231 | for my $filename (@ARGV) { |
232 | my $FILE; | ||
229 | if ($file) { | 233 | if ($file) { |
230 | open(FILE, "diff -u /dev/null $filename|") || | 234 | open($FILE, '-|', "diff -u /dev/null $filename") || |
231 | die "$P: $filename: diff failed - $!\n"; | 235 | die "$P: $filename: diff failed - $!\n"; |
236 | } elsif ($filename eq '-') { | ||
237 | open($FILE, '<&STDIN'); | ||
232 | } else { | 238 | } else { |
233 | open(FILE, "<$filename") || | 239 | open($FILE, '<', "$filename") || |
234 | die "$P: $filename: open failed - $!\n"; | 240 | die "$P: $filename: open failed - $!\n"; |
235 | } | 241 | } |
236 | if ($filename eq '-') { | 242 | if ($filename eq '-') { |
@@ -238,11 +244,11 @@ for my $filename (@ARGV) { | |||
238 | } else { | 244 | } else { |
239 | $vname = $filename; | 245 | $vname = $filename; |
240 | } | 246 | } |
241 | while (<FILE>) { | 247 | while (<$FILE>) { |
242 | chomp; | 248 | chomp; |
243 | push(@rawlines, $_); | 249 | push(@rawlines, $_); |
244 | } | 250 | } |
245 | close(FILE); | 251 | close($FILE); |
246 | if (!process($filename)) { | 252 | if (!process($filename)) { |
247 | $exit = 1; | 253 | $exit = 1; |
248 | } | 254 | } |