Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40558 )
Change subject: soc/intel/common/block/smbus: Set SPD array NULL if no DIMM present ......................................................................
Patch Set 8: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/40558/8/src/soc/intel/common/block/... File src/soc/intel/common/block/smbus/smbuslib.c:
https://review.coreboot.org/c/coreboot/+/40558/8/src/soc/intel/common/block/... PS8, Line 50: memset(spd, 0, CONFIG_DIMM_SPD_SIZE); nit: I think you can avoid doing this memset and instead return a -1 which can be checked by the caller.
https://review.coreboot.org/c/coreboot/+/40558/8/src/soc/intel/common/block/... PS8, Line 79: if (spd_data[i * CONFIG_DIMM_SPD_SIZE] != 0) : blk->spd_array[i] = &spd_data[i * CONFIG_DIMM_SPD_SIZE]; : else : blk->spd_array[i] = NULL; Continuing my comment above: This can be changed to: if (get_spd(...) < 0) blk->spd_array[i] = NULL; else blk->spd_array[i] = &spd_data[i * CONFIG_DIMM_SPD_SIZE];