Browse Source

Filter non-DIMM EEPROMs earlier. This saves one level of indentation in

the main loop.


git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5692 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.3
Jean Delvare 17 years ago
parent
commit
cd79c7c2f8
  1. 12
      eeprom/decode-dimms

12
eeprom/decode-dimms

@ -1625,7 +1625,8 @@ sub get_dimm_list
if (opendir(local *DIR, $dir)) { if (opendir(local *DIR, $dir)) {
while (defined($file = readdir(DIR))) { while (defined($file = readdir(DIR))) {
next if $file =~ m/^\./;
next if $use_sysfs && $file !~ /^\d+-\d+$/;
next if !$use_sysfs && $file !~ /^eeprom-/;
push @files, $file; push @files, $file;
} }
close(DIR); close(DIR);
@ -1639,10 +1640,6 @@ sub get_dimm_list
@dimm_list = get_dimm_list() unless $use_hexdump; @dimm_list = get_dimm_list() unless $use_hexdump;
for my $i (0 .. $#dimm_list) { for my $i (0 .. $#dimm_list) {
$_ = $dimm_list[$i];
if (($use_sysfs && /^\d+-\d+$/)
|| (!$use_sysfs && /^eeprom-/)
|| $use_hexdump) {
my @bytes = readspd(0, 128, $dimm_list[$i]); my @bytes = readspd(0, 128, $dimm_list[$i]);
my $is_rambus = $bytes[0] < 4; # Simple heuristic my $is_rambus = $bytes[0] < 4; # Simple heuristic
my ($label, $chk_valid, $chk_spd, $chk_calc); my ($label, $chk_valid, $chk_spd, $chk_calc);
@ -1665,8 +1662,8 @@ for my $i (0 .. $#dimm_list) {
print "</u></b>" if $opt_html; print "</u></b>" if $opt_html;
print "<table border=1>\n" if $opt_html; print "<table border=1>\n" if $opt_html;
if (!$use_hexdump) { if (!$use_hexdump) {
if (($use_sysfs && /^[^-]+-([^-]+)$/)
|| (!$use_sysfs && /^[^-]+-[^-]+-[^-]+-([^-]+)$/)) {
if (($use_sysfs && $dimm_list[$i] =~ /^[^-]+-([^-]+)$/)
|| (!$use_sysfs && $dimm_list[$i] =~ /^[^-]+-[^-]+-[^-]+-([^-]+)$/)) {
my $dimm_num = $1 - 49; my $dimm_num = $1 - 49;
printl("Guessing DIMM is in", "bank $dimm_num"); printl("Guessing DIMM is in", "bank $dimm_num");
} }
@ -1743,7 +1740,6 @@ for my $i (0 .. $#dimm_list) {
print "</table>\n" if $opt_html; print "</table>\n" if $opt_html;
} }
}
printl2("\n\nNumber of SDRAM DIMMs detected and decoded", $dimm_count); printl2("\n\nNumber of SDRAM DIMMs detected and decoded", $dimm_count);
print "</body></html>\n" if ($opt_html && !$opt_bodyonly); print "</body></html>\n" if ($opt_html && !$opt_bodyonly);
Loading…
Cancel
Save