Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44782 )
Change subject: fw_config: Add caching to successfully probed fields ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/44782/3/src/include/fw_config.h File src/include/fw_config.h:
https://review.coreboot.org/c/coreboot/+/44782/3/src/include/fw_config.h@48 PS3, Line 48: void fw_config_for_each_found(void (*cb)(const struct fw_config *config, void *arg), void *arg); For the use case you have, wouldn't a fw_config_get_cached(field_mask) API be more useful? You're just iterating through them all to find a specific one anyway, and you know the index you want to check already.
https://review.coreboot.org/c/coreboot/+/44782/3/src/lib/fw_config.c File src/lib/fw_config.c:
https://review.coreboot.org/c/coreboot/+/44782/3/src/lib/fw_config.c@78 PS3, Line 78: void fw_config_for_each_found(void (*cb)(const struct fw_config *config, void *arg), void *arg) I think you should move this under the #if ENV_RAMSTAGE block, since it can't possibly do anything useful in other stages. Forcing a link error when someone tries to use it in a way that cannot work may help prevent mistakes.