Skip to content

Commit dbbe33e

Browse files
Stephen Hemmingermichal42
authored andcommitted
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>
1 parent 91416cf commit dbbe33e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎scripts/headers_check.pl‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@
2828
my $filename;
2929

3030
foreach my $file (@files) {
31-
local *FH;
3231
$filename = $file;
33-
open(FH, "<$filename") or die "$filename: $!\n";
32+
33+
open(my $fh, '<', $filename)
34+
or die "$filename: $!\n";
3435
$lineno = 0;
35-
while ($line = <FH>) {
36+
while ($line = <$fh>) {
3637
$lineno++;
3738
&check_include();
3839
&check_asm_types();
3940
&check_sizetypes();
4041
&check_declarations();
4142
# Dropped for now. Too much noise &check_config();
4243
}
43-
close FH;
44+
close $fh;
4445
}
4546
exit $ret;
4647

@@ -78,7 +79,7 @@ sub check_config
7879
}
7980

8081
my $linux_asm_types;
81-
sub check_asm_types()
82+
sub check_asm_types
8283
{
8384
if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) {
8485
return;

0 commit comments

Comments
 (0)