kbuild: fix perl usage in export_report.pl

Fixes some subtle perl coding bug observed
by Jan Engelhardt <jengelh@computergmbh.de>
This patch applies on top of Adrian's fix.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Acked-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
Ram Pai 2007-08-24 15:32:22 -07:00 committed by Sam Ravnborg
parent cf9a6adeae
commit 88f567f3a3

View file

@ -103,15 +103,15 @@ foreach my $thismod (@allcfiles) {
my $state=0; my $state=0;
while ( <MODULE_MODULE> ) { while ( <MODULE_MODULE> ) {
chomp; chomp;
if ($state eq 0) { if ($state == 0) {
$state = 1 if ($_ =~ /static const struct modversion_info/); $state = 1 if ($_ =~ /static const struct modversion_info/);
next; next;
} }
if ($state eq 1) { if ($state == 1) {
$state = 2 if ($_ =~ /__attribute__\(\(section\("__versions"\)\)\)/); $state = 2 if ($_ =~ /__attribute__\(\(section\("__versions"\)\)\)/);
next; next;
} }
if ($state eq 2) { if ($state == 2) {
if ( $_ !~ /0x[0-9a-f]+,/ ) { if ( $_ !~ /0x[0-9a-f]+,/ ) {
next; next;
} }
@ -121,7 +121,7 @@ foreach my $thismod (@allcfiles) {
push(@{$MODULE{$thismod}} , $sym); push(@{$MODULE{$thismod}} , $sym);
} }
} }
if ($state ne 2) { if ($state != 2) {
print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n"; print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n";
} }
close(MODULE_MODULE); close(MODULE_MODULE);