Fix rounding error in PCxxxx DDR SDRAM speed computation.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3121 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2005-10-15 10:28:08 +00:00
1 parent d2e6e8561b
commit fcdc235ee3
1 file changed
+1
+1
View File
@@ -484,6 +484,7 @@ for my $i ( 0 .. $#dimm_list ) {
my $tbits = ($bytes[7]*256) + $bytes[6];
if (($bytes[11] == 2) || ($bytes[11] == 1)) { $tbits = $tbits - 8;}
my $pcclk = int ($ddrclk * $tbits / 8);
$pcclk += 100 if ($pcclk % 100) >= 50; # Round properly
$pcclk = $pcclk - ($pcclk % 100);
$ddrclk = int ($ddrclk);
printl "Maximum module speed", "$ddr ${ddrclk}MHz (PC${pcclk})";