Commit dbbe33e9 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Michal Marek

headers_check: fix perl warnings

According to PBP; best way practice is to use local reference for file
handle and three argument open. Also perl prototypes are a mistake.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Acked-by: default avatarWANG Cong <amwang@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 91416cfd
...@@ -28,11 +28,12 @@ my $lineno = 0; ...@@ -28,11 +28,12 @@ my $lineno = 0;
my $filename; my $filename;
foreach my $file (@files) { foreach my $file (@files) {
local *FH;
$filename = $file; $filename = $file;
open(FH, "<$filename") or die "$filename: $!\n";
open(my $fh, '<', $filename)
or die "$filename: $!\n";
$lineno = 0; $lineno = 0;
while ($line = <FH>) { while ($line = <$fh>) {
$lineno++; $lineno++;
&check_include(); &check_include();
&check_asm_types(); &check_asm_types();
...@@ -40,7 +41,7 @@ foreach my $file (@files) { ...@@ -40,7 +41,7 @@ foreach my $file (@files) {
&check_declarations(); &check_declarations();
# Dropped for now. Too much noise &check_config(); # Dropped for now. Too much noise &check_config();
} }
close FH; close $fh;
} }
exit $ret; exit $ret;
...@@ -78,7 +79,7 @@ sub check_config ...@@ -78,7 +79,7 @@ sub check_config
} }
my $linux_asm_types; my $linux_asm_types;
sub check_asm_types() sub check_asm_types
{ {
if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) {
return; return;
......
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