From 378d79eb30f1fd990a17b26840741adfce35a8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 21 Nov 2016 02:39:59 +0200 Subject: device/dram/ddr3: Fix calculation CRC16 of SPD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression with commit: 7dc4b84 device/dram/ddr3: Calculate CRC16 of SPD unique identifier Misplaced parenthesis causes CRC check failure, potentially rendering some platform unbootable. Change-Id: I9699ee2ead5b99c7f46f6f4682235aae3125cca6 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/17550 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks --- src/device/dram/ddr3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/device/dram') diff --git a/src/device/dram/ddr3.c b/src/device/dram/ddr3.c index b3bcd680fe..6e5c541a85 100644 --- a/src/device/dram/ddr3.c +++ b/src/device/dram/ddr3.c @@ -52,7 +52,7 @@ static u16 crc16(const u8 *ptr, int n_crc) u16 crc = 0; while (--n_crc >= 0) { - crc = (crc ^ (int)*ptr++) << 8; + crc = crc ^ ((int)*ptr++ << 8); for (i = 0; i < 8; ++i) if (crc & 0x8000) { crc = (crc << 1) ^ 0x1021; -- cgit v1.2.3