mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
checkversion: perl cleanup
Turn on strict checking. Use three arguement open Standard practice in perl is to use undef not zero for false Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Cc: Cong Wang <amwang@redhat.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
parent
3da2715731
commit
a208868fc0
@ -5,23 +5,22 @@
|
|||||||
# including <linux/version.h> that don't need it.
|
# including <linux/version.h> that don't need it.
|
||||||
# Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
|
# Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
$| = 1;
|
$| = 1;
|
||||||
|
|
||||||
my $debugging = 0;
|
my $debugging;
|
||||||
|
|
||||||
foreach $file (@ARGV)
|
foreach my $file (@ARGV) {
|
||||||
{
|
|
||||||
# Open this file.
|
# Open this file.
|
||||||
open(FILE, $file) || die "Can't open $file: $!\n";
|
open( my $f, '<', $file )
|
||||||
|
or die "Can't open $file: $!\n";
|
||||||
|
|
||||||
# Initialize variables.
|
# Initialize variables.
|
||||||
my $fInComment = 0;
|
my ($fInComment, $fInString, $fUseVersion);
|
||||||
my $fInString = 0;
|
|
||||||
my $fUseVersion = 0;
|
|
||||||
my $iLinuxVersion = 0;
|
my $iLinuxVersion = 0;
|
||||||
|
|
||||||
LINE: while ( <FILE> )
|
while (<$f>) {
|
||||||
{
|
|
||||||
# Strip comments.
|
# Strip comments.
|
||||||
$fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next);
|
$fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next);
|
||||||
m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1)));
|
m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1)));
|
||||||
@ -43,8 +42,8 @@ foreach $file (@ARGV)
|
|||||||
# Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
|
# Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
|
||||||
if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
|
if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
|
||||||
$fUseVersion = 1;
|
$fUseVersion = 1;
|
||||||
last LINE if $iLinuxVersion;
|
last if $iLinuxVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Report used version IDs without include?
|
# Report used version IDs without include?
|
||||||
@ -67,5 +66,5 @@ foreach $file (@ARGV)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close(FILE);
|
close($f);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user