summaryrefslogtreecommitdiffstats
path: root/convert/merge2pcitable.pl
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-03-24 18:16:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-03-24 18:16:10 +0000
commitae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d (patch)
tree14c814e4820607c8919fc793369372370d5cf1d5 /convert/merge2pcitable.pl
parent7f58ffae7b917309d4d90a3becd0456c7277d72a (diff)
downloadldetect-lst-ae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d.tar
ldetect-lst-ae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d.tar.gz
ldetect-lst-ae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d.tar.bz2
ldetect-lst-ae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d.tar.xz
ldetect-lst-ae92c8c4d4bcba8d2cf0e75973545c56d0db1d0d.zip
(cleanup_subids): cleanup
Diffstat (limited to 'convert/merge2pcitable.pl')
-rwxr-xr-xconvert/merge2pcitable.pl18
1 files changed, 14 insertions, 4 deletions
diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl
index b5fd394b..354720cc 100755
--- a/convert/merge2pcitable.pl
+++ b/convert/merge2pcitable.pl
@@ -1,5 +1,10 @@
#!/usr/bin/perl
+@ignored_modules = (
+qw(alsa ignore),
+qw(tr bcm5700), # redhat have this, ignore it
+);
+
if ($0 =~ /merge2pcitable/)
{
$ARGV[0] eq '-f' and $force = shift;
@@ -19,15 +24,20 @@ if ($0 =~ /merge2pcitable/)
write_pcitable($d_pci);
} else { 1 }
+sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }
+
+sub dummy_module {
+ my ($m) = @_;
+ $m =~ s/"(.*)"/$1/;
+ member($m, @ignored_modules);
+}
+
sub to_string {
my ($id, $driver) = @_;
my ($module, $text) = map { qq("$_") } @$driver;
my ($id1, $id2, $subid1, $subid2) = map { "0x$_" } ($id =~ /(....)/g);
join "\t", $id1, $id2, "$subid1 $subid2" ne "0xffff 0xffff" ? ($subid1, $subid2) : (), $module, $text;
}
-sub dummy_module {
- $_[0] =~ /alsa|ignore/;
-}
# works for RedHat's pcitable old and new format, + mdk format (alike RedHat's old one)
# (the new format has ending .o's and double quotes are removed)
@@ -175,7 +185,7 @@ sub merge {
sub cleanup_subids {
my ($drivers) = @_;
- my %l, %m;
+ my (%l, %m);
foreach (sort keys %$drivers) {
my ($id, $subid) = /(........)(........)/;
if ($l{$id}) {