Attention is currently required from: Anastasia Klimchuk, Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/75646?usp=email )
Change subject: Replace all flashchips accesses with get functions ......................................................................
Patch Set 5:
(6 comments)
Patchset:
PS5: good thoughts on the simplification.. maybe generally the API should already have an init function at this point that handles a possible failure case (flashchips = NULL) and bails out so we don't have to test for null/0 at various places in the code over and again.
File flashchips.c:
https://review.coreboot.org/c/flashrom/+/75646/comment/ab2028b4_0acf0ddf : PS5, Line 34: internal_
no need to rename if it becomes static, also "internal" is a overloaded term with the internal progr […]
i understand there is no technical need, but i did it to make it more obvious that it is not coming from the outside. it keeps the code easier to understand
https://review.coreboot.org/c/flashrom/+/75646/comment/571ad0b5_ced6bafb : PS5, Line 20844: get_flashchips(void)
you *could* have a signature of: […]
sure, but that would be more complex.
https://review.coreboot.org/c/flashrom/+/75646/comment/e0d7eb5f_cdff91bf : PS5, Line 20849: unsigned int
should be `size_t` for the size of an array.
maybe so. it was unsigned int before, so i didn't change it. if we want to fix that, we could do that in a separate patch that focused on that. trying to keep it to one logical change per patch
File ichspi.c:
https://review.coreboot.org/c/flashrom/+/75646/comment/3f7ed0e0_aa93c407 : PS5, Line 1469: const struct flashchip *chip; : : struct flashchip *flashchips=get_flashchips(); : : if (!flashchips) : return NULL;
very clever. and doesn't check the return value. i suppose we could bail out earlier if we don't have a good database in memory
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/75646/comment/39849728_2d12ddb0 : PS5, Line 95: unsigned int
size_t
shouldn't then i downstairs also be size_t? not against this, but it seems that is a larger consistency cleanup that needs to happen across the tree separately if this is a notion that is agreed upon.