Attention is currently required from: Arthur Heymans, Nico Huber, Philipp Hug.
Maximilian Brune has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/68842?usp=email )
Change subject: lib/ramdetect: Limit probe size to function argument ......................................................................
Patch Set 10:
(1 comment)
File src/lib/ramdetect.c:
https://review.coreboot.org/c/coreboot/+/68842/comment/5dcc091b_4c19894f : PS7, Line 50: /* Find the MSB + 1. */
Wouldn't starting with MSB instead achieve the same?
I don't think finding MSB+1 should be used either. Because MSB+1 will always trigger the if condition below. I would just make the do-while loop to a generic while loop. ``` while (tmp >>= 1) { msb++; } ``` But that would still require to check that we don't probe something above probe_size. Unless probe_size is a power of 2, but I am not sure if that is a requirement for this function.