From fbb3a5046487f0edb4f6354659670c7f088be4ee Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 20 Mar 2009 14:09:43 +0000 Subject: [PATCH] The DIMM addresses are hexadecimal values, handle them as such. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5693 7894878c-1315-0410-8ee3-d5d059ff63e0 --- eeprom/decode-dimms | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index ec71236..a161726 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -1625,7 +1625,7 @@ sub get_dimm_list if (opendir(local *DIR, $dir)) { while (defined($file = readdir(DIR))) { - next if $use_sysfs && $file !~ /^\d+-\d+$/; + next if $use_sysfs && $file !~ /^\d+-[\da-f]+$/i; next if !$use_sysfs && $file !~ /^eeprom-/; push @files, $file; } @@ -1662,10 +1662,11 @@ for my $i (0 .. $#dimm_list) { print "" if $opt_html; print "\n" if $opt_html; if (!$use_hexdump) { - if (($use_sysfs && $dimm_list[$i] =~ /^[^-]+-([^-]+)$/) - || (!$use_sysfs && $dimm_list[$i] =~ /^[^-]+-[^-]+-[^-]+-([^-]+)$/)) { - my $dimm_num = $1 - 49; - printl("Guessing DIMM is in", "bank $dimm_num"); + if ($dimm_list[$i] =~ /-([\da-f]+)$/i) { + my $dimm_num = hex($1) - 0x50 + 1; + if ($dimm_num >= 1 && $dimm_num <= 8) { + printl("Guessing DIMM is in", "bank $dimm_num"); + } } }