[PATCH 6/7] decode-dimms: Bad manufacturer page count parity is not fatal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If DDR3 manufacturer page count parity is wrong, still print the
manufacturer name (if valid) but add a question mark.
---
 eeprom/decode-dimms |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2012-11-15 11:45:52.020974740 +0100
+++ i2c-tools/eeprom/decode-dimms	2012-11-15 11:47:17.878976012 +0100
@@ -337,10 +337,13 @@ sub parity($)
 sub manufacturer_ddr3($$)
 {
 	my ($count, $code) = @_;
-	return "Invalid" if parity($count) != 1;
+	my $manufacturer;
+
 	return "Invalid" if parity($code) != 1;
-	return (($code & 0x7F) - 1 > $vendors[$count & 0x7F]) ? "Unknown" :
-		$vendors[$count & 0x7F][($code & 0x7F) - 1];
+	return "Unknown" if ($code & 0x7F) - 1 > $vendors[$count & 0x7F];
+	$manufacturer = $vendors[$count & 0x7F][($code & 0x7F) - 1];
+	$manufacturer .= "? (Invalid parity)" if parity($count) != 1;
+	return $manufacturer;
 }
 
 sub manufacturer(@)

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux