mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-03 15:55:15 +00:00
Reindent the rest of the code. At last! :)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5488 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -3479,7 +3479,7 @@ sub lm90_detect
|
||||
return if ($conf & 0x2a) != 0;
|
||||
return if $rate > 0x09;
|
||||
return if $mid != 0x5c; # Winbond
|
||||
return 6 $cid == 0x00; # W83L771W/G
|
||||
return 6 if $cid == 0x00; # W83L771W/G
|
||||
}
|
||||
if ($chip == 9) {
|
||||
return if ($conf & 0x1B) != 0;
|
||||
@@ -4831,9 +4831,11 @@ sub generate_modprobes
|
||||
}
|
||||
|
||||
next if not @optionlist;
|
||||
$configfile = "# hwmon module options\n" unless defined $configfile;
|
||||
$configfile = "# hwmon module options\n"
|
||||
unless defined $configfile;
|
||||
$configfile .= "options $chip->{driver}";
|
||||
$configfile .= sprintf(" ignore=%d,0x%02x", shift @optionlist,
|
||||
$configfile .= sprintf(" ignore=%d,0x%02x",
|
||||
shift @optionlist,
|
||||
shift @optionlist);
|
||||
$configfile .= sprintf(",%d,0x%02x", shift @optionlist,
|
||||
shift @optionlist) while @optionlist;
|
||||
@@ -4877,7 +4879,8 @@ sub generate_modprobes
|
||||
}
|
||||
}
|
||||
close(INPUTFILE);
|
||||
#check return value from modprobe in case modprobe -l isn't supported
|
||||
# Check return value from modprobe in case modprobe -l
|
||||
# isn't supported
|
||||
if ((($? >> 8) == 0) && ! $modulefound) {
|
||||
$modprobes .= "# Warning: the required module $chip->{driver} is not currently installed\n".
|
||||
"# on your system. For status of 2.6 kernel ports check\n".
|
||||
@@ -4889,7 +4892,6 @@ sub generate_modprobes
|
||||
}
|
||||
|
||||
return ($modprobes, $configfile);
|
||||
|
||||
}
|
||||
|
||||
sub main
|
||||
@@ -4909,19 +4911,17 @@ sub main
|
||||
initialize_conf();
|
||||
initialize_pci();
|
||||
initialize_modules_list();
|
||||
# make sure any special case chips are added to the chip_ids list before
|
||||
# making the support modules list
|
||||
# Make sure any special case chips are added to the chip_ids list
|
||||
# before making the support modules list
|
||||
chip_special_cases();
|
||||
initialize_modules_supported();
|
||||
initialize_cpu_list();
|
||||
|
||||
print "# sensors-detect revision $revision\n\n";
|
||||
|
||||
print "This program will help you determine which kernel modules you need\n",
|
||||
"to load to use lm_sensors most effectively. It is generally safe\n",
|
||||
"and recommended to accept the default answers to all questions,\n",
|
||||
"unless you know what you're doing.\n";
|
||||
print "\n";
|
||||
"unless you know what you're doing.\n\n";
|
||||
|
||||
adapter_pci_detection();
|
||||
print "\n";
|
||||
@@ -4950,10 +4950,8 @@ sub main
|
||||
|
||||
$inp = <STDIN>;
|
||||
if ($inp =~ /^\s*[Ss]/) {
|
||||
print "Please enter one or more addresses not to scan. Separate them ",
|
||||
"with comma's.\n",
|
||||
"You can specify a range by using dashes. Addresses may be ",
|
||||
"decimal (like 54)\n",
|
||||
print "Please enter one or more addresses not to scan. Separate them with comma's.\n",
|
||||
"You can specify a range by using dashes. Addresses may be decimal (like 54)\n",
|
||||
"or hexadecimal (like 0x33).\n",
|
||||
"Addresses: ";
|
||||
$inp2 = <STDIN>;
|
||||
@@ -4970,8 +4968,8 @@ sub main
|
||||
&& $kernel_arch ne 'ppc64') {
|
||||
print "Some chips are also accessible through the ISA I/O ports. We have to\n".
|
||||
"write to arbitrary I/O ports to probe them. This is usually safe though.\n".
|
||||
"Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n";
|
||||
print "Do you want to scan the ISA I/O ports? (YES/no): ";
|
||||
"Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n".
|
||||
"Do you want to scan the ISA I/O ports? (YES/no): ";
|
||||
unless (<STDIN> =~ /^\s*n/i) {
|
||||
initialize_ioports();
|
||||
scan_isa_bus();
|
||||
@@ -4991,8 +4989,8 @@ sub main
|
||||
print "\n";
|
||||
}
|
||||
|
||||
print "Some south bridges, CPUs or memory controllers may also contain\n";
|
||||
print "embedded sensors. Do you want to scan for them? (YES/no): ";
|
||||
print "Some south bridges, CPUs or memory controllers may also contain\n".
|
||||
"embedded sensors. Do you want to scan for them? (YES/no): ";
|
||||
unless (<STDIN> =~ /^\s*n/i) {
|
||||
$| = 1;
|
||||
foreach my $entry (@cpu_ids) {
|
||||
@@ -5002,7 +5000,7 @@ sub main
|
||||
}
|
||||
print "\n";
|
||||
|
||||
if (! @chips_detected) {
|
||||
if (!@chips_detected) {
|
||||
print "Sorry, no sensors were detected.\n",
|
||||
"Either your sensors are not supported, or they are connected to an\n",
|
||||
"I2C or SMBus adapter that is not supported. See\n",
|
||||
@@ -5039,8 +5037,7 @@ sub main
|
||||
}
|
||||
open(local *MODPROBE_D, ">/etc/modprobe.d/lm_sensors")
|
||||
or die "Sorry, can't create /etc/modprobe.d/lm_sensors ($!)";
|
||||
print MODPROBE_D
|
||||
"# Generated by sensors-detect on " . scalar localtime() . "\n";
|
||||
print MODPROBE_D "# Generated by sensors-detect on " . scalar localtime() . "\n";
|
||||
print MODPROBE_D $configfile;
|
||||
close(MODPROBE_D);
|
||||
} else {
|
||||
@@ -5098,8 +5095,6 @@ sub main
|
||||
# List the modules that are to be loaded for your system
|
||||
#
|
||||
EOT
|
||||
print SYSCONFIG
|
||||
"# Generated by sensors-detect on " . scalar localtime() . "\n";
|
||||
my @modules = grep /^modprobe /, split "\n", $modprobes;
|
||||
my $i = 0;
|
||||
my $sysconfig = "";
|
||||
@@ -5108,6 +5103,7 @@ EOT
|
||||
$sysconfig .= "MODULE_$i=$_\n";
|
||||
$i++;
|
||||
}
|
||||
print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
|
||||
print SYSCONFIG $sysconfig;
|
||||
close(SYSCONFIG);
|
||||
|
||||
@@ -5133,7 +5129,7 @@ EOT
|
||||
$modprobes.
|
||||
(-e '/usr/bin/sensors' ?
|
||||
"/usr/bin/sensors -s\n" :
|
||||
"/usr/local/bin/sensors -s\n") .
|
||||
"/usr/local/bin/sensors -s\n").
|
||||
"#----cut here----\n\n";
|
||||
|
||||
print "If you have some drivers built into your kernel, the list above will\n".
|
||||
|
Reference in New Issue
Block a user