Commit 21caa13c authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds

checkpatch: fix the perlcritic errors

Clean up checkpatch using perlcritic.
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2b6db5cb
...@@ -69,7 +69,9 @@ my $dbg_possible = 0; ...@@ -69,7 +69,9 @@ my $dbg_possible = 0;
my $dbg_type = 0; my $dbg_type = 0;
my $dbg_attr = 0; my $dbg_attr = 0;
for my $key (keys %debug) { for my $key (keys %debug) {
eval "\${dbg_$key} = '$debug{$key}';" ## no critic
eval "\${dbg_$key} = '$debug{$key}';";
die "$@" if ($@);
} }
if ($terse) { if ($terse) {
...@@ -206,9 +208,9 @@ my @dep_includes = (); ...@@ -206,9 +208,9 @@ my @dep_includes = ();
my @dep_functions = (); my @dep_functions = ();
my $removal = "Documentation/feature-removal-schedule.txt"; my $removal = "Documentation/feature-removal-schedule.txt";
if ($tree && -f "$root/$removal") { if ($tree && -f "$root/$removal") {
open(REMOVE, "<$root/$removal") || open(my $REMOVE, '<', "$root/$removal") ||
die "$P: $removal: open failed - $!\n"; die "$P: $removal: open failed - $!\n";
while (<REMOVE>) { while (<$REMOVE>) {
if (/^Check:\s+(.*\S)/) { if (/^Check:\s+(.*\S)/) {
for my $entry (split(/[, ]+/, $1)) { for my $entry (split(/[, ]+/, $1)) {
if ($entry =~ m@include/(.*)@) { if ($entry =~ m@include/(.*)@) {
...@@ -220,17 +222,21 @@ if ($tree && -f "$root/$removal") { ...@@ -220,17 +222,21 @@ if ($tree && -f "$root/$removal") {
} }
} }
} }
close($REMOVE);
} }
my @rawlines = (); my @rawlines = ();
my @lines = (); my @lines = ();
my $vname; my $vname;
for my $filename (@ARGV) { for my $filename (@ARGV) {
my $FILE;
if ($file) { if ($file) {
open(FILE, "diff -u /dev/null $filename|") || open($FILE, '-|', "diff -u /dev/null $filename") ||
die "$P: $filename: diff failed - $!\n"; die "$P: $filename: diff failed - $!\n";
} elsif ($filename eq '-') {
open($FILE, '<&STDIN');
} else { } else {
open(FILE, "<$filename") || open($FILE, '<', "$filename") ||
die "$P: $filename: open failed - $!\n"; die "$P: $filename: open failed - $!\n";
} }
if ($filename eq '-') { if ($filename eq '-') {
...@@ -238,11 +244,11 @@ for my $filename (@ARGV) { ...@@ -238,11 +244,11 @@ for my $filename (@ARGV) {
} else { } else {
$vname = $filename; $vname = $filename;
} }
while (<FILE>) { while (<$FILE>) {
chomp; chomp;
push(@rawlines, $_); push(@rawlines, $_);
} }
close(FILE); close($FILE);
if (!process($filename)) { if (!process($filename)) {
$exit = 1; $exit = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment