Commit dbbe33e99f41a6f07e61dbce455964112d8ac72b
Committed by
Michal Marek
1 parent
91416cfdf9
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: Stephen Hemminger <shemminger@vyatta.com> Acked-by: WANG Cong <amwang@redhat.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
Showing 1 changed file with 6 additions and 5 deletions Side-by-side Diff
scripts/headers_check.pl
... | ... | @@ -28,11 +28,12 @@ |
28 | 28 | my $filename; |
29 | 29 | |
30 | 30 | foreach my $file (@files) { |
31 | - local *FH; | |
32 | 31 | $filename = $file; |
33 | - open(FH, "<$filename") or die "$filename: $!\n"; | |
32 | + | |
33 | + open(my $fh, '<', $filename) | |
34 | + or die "$filename: $!\n"; | |
34 | 35 | $lineno = 0; |
35 | - while ($line = <FH>) { | |
36 | + while ($line = <$fh>) { | |
36 | 37 | $lineno++; |
37 | 38 | &check_include(); |
38 | 39 | &check_asm_types(); |
... | ... | @@ -40,7 +41,7 @@ |
40 | 41 | &check_declarations(); |
41 | 42 | # Dropped for now. Too much noise &check_config(); |
42 | 43 | } |
43 | - close FH; | |
44 | + close $fh; | |
44 | 45 | } |
45 | 46 | exit $ret; |
46 | 47 | |
... | ... | @@ -78,7 +79,7 @@ |
78 | 79 | } |
79 | 80 | |
80 | 81 | my $linux_asm_types; |
81 | -sub check_asm_types() | |
82 | +sub check_asm_types | |
82 | 83 | { |
83 | 84 | if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { |
84 | 85 | return; |