Skip to content

Commit

Permalink
checkpatch: fix the perlcritic errors
Browse files Browse the repository at this point in the history
Clean up checkpatch using perlcritic.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jan 6, 2009
1 parent 2b6db5c commit 21caa13
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
my $dbg_type = 0;
my $dbg_attr = 0;
for my $key (keys %debug) {
eval "\${dbg_$key} = '$debug{$key}';"
## no critic
eval "\${dbg_$key} = '$debug{$key}';";
die "$@" if ($@);
}

if ($terse) {
Expand Down Expand Up @@ -206,9 +208,9 @@ sub build_types {
my @dep_functions = ();
my $removal = "Documentation/feature-removal-schedule.txt";
if ($tree && -f "$root/$removal") {
open(REMOVE, "<$root/$removal") ||
open(my $REMOVE, '<', "$root/$removal") ||
die "$P: $removal: open failed - $!\n";
while (<REMOVE>) {
while (<$REMOVE>) {
if (/^Check:\s+(.*\S)/) {
for my $entry (split(/[, ]+/, $1)) {
if ($entry =~ m@include/(.*)@) {
Expand All @@ -220,29 +222,33 @@ sub build_types {
}
}
}
close($REMOVE);
}

my @rawlines = ();
my @lines = ();
my $vname;
for my $filename (@ARGV) {
my $FILE;
if ($file) {
open(FILE, "diff -u /dev/null $filename|") ||
open($FILE, '-|', "diff -u /dev/null $filename") ||
die "$P: $filename: diff failed - $!\n";
} elsif ($filename eq '-') {
open($FILE, '<&STDIN');
} else {
open(FILE, "<$filename") ||
open($FILE, '<', "$filename") ||
die "$P: $filename: open failed - $!\n";
}
if ($filename eq '-') {
$vname = 'Your patch';
} else {
$vname = $filename;
}
while (<FILE>) {
while (<$FILE>) {
chomp;
push(@rawlines, $_);
}
close(FILE);
close($FILE);
if (!process($filename)) {
$exit = 1;
}
Expand Down

0 comments on commit 21caa13

Please sign in to comment.