HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35558 )
Change subject: src/device/dram/ddr4: Fix "Dead assignment" ......................................................................
src/device/dram/ddr4: Fix "Dead assignment"
The value stored to 'spd_bytes_total' is never read, so let use it to check if 'SPD Bytes Total' and/or 'SPD Bytes Used' are reserved.
Change-Id: I426a7e64cc4c0bcced91d03387e02c8d965a21dc Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/device/dram/ddr4.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/35558/1
diff --git a/src/device/dram/ddr4.c b/src/device/dram/ddr4.c index 4f99ecc..472a771 100644 --- a/src/device/dram/ddr4.c +++ b/src/device/dram/ddr4.c @@ -120,6 +120,13 @@ }
spd_bytes_total = 256 << (spd_bytes_total - 1); + + if (spd_bytes_total > 512) + printk(BIOS_WARNING, "SPD Bytes Total value is reserved\n"); + + if (spd_bytes_used > 4) + printk(BIOS_WARNING, "SPD Bytes Used value is reserved\n"); + spd_bytes_used = spd_bytes_used_table[spd_bytes_used];
/* Verify CRC of blocks that have them, do not step over 'used' length */