From 791b27fbe45038568a78450fd1220aa2051f1197 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 30 Nov 2008 12:53:18 +0000 Subject: [PATCH] Rework adapter_pci_detection to require fewer levels of indentation. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5470 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 46 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 675846b9..1afcb5c5 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2207,31 +2207,31 @@ sub adapter_pci_detection # Loop over the known I2C/SMBus adapters foreach $try (@pci_adapters) { $key = sprintf("%04x:%04x", $try->{vendid}, $try->{devid}); - if (exists $pci_list{$key}) { - $device = $pci_list{$key}; - if ($try->{driver} =~ m/^to-be-/) { - printf "No known driver for device \%s: \%s\n", - pci_busid($device), $try->{procid}; + next unless exists $pci_list{$key}; - if ($try->{driver} eq "to-be-tested") { - print "\nWe are currently looking for testers for this adapter!\n". - "Please check http://www.lm-sensors.org/wiki/Devices\n". - "and/or contact us if you want to help.\n\n"; - print "Continue... "; - ; - print "\n"; - } - } else { - printf "Using driver `\%s' for device \%s: \%s\n", - $try->{driver}, pci_busid($device), - $try->{procid}; - $count++; - load_module($try->{driver}); - } - - # Delete from detected SMBus device list - delete $smbus{$key}; + $device = $pci_list{$key}; + if ($try->{driver} eq "to-be-tested") { + print "\nWe are currently looking for testers for this adapter!\n". + "Please check http://www.lm-sensors.org/wiki/Devices\n". + "and/or contact us if you want to help.\n\n". + "Continue... "; + ; + print "\n"; } + + if ($try->{driver} =~ m/^to-be-/) { + printf "No known driver for device \%s: \%s\n", + pci_busid($device), $try->{procid}; + } else { + printf "Using driver `\%s' for device \%s: \%s\n", + $try->{driver}, pci_busid($device), + $try->{procid}; + $count++; + load_module($try->{driver}); + } + + # Delete from detected SMBus device list + delete $smbus{$key}; } # Now see if there are unknown SMBus devices left