Nico Huber has posted comments on this change. ( https://review.coreboot.org/23203 )
Change subject: [WIP]Add support to get layout from a binary fmap file ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/#/c/23203/5/fmap.h File fmap.h:
https://review.coreboot.org/#/c/23203/5/fmap.h@27 PS5, Line 27: struct fmap_area areas[]; You could just give it a number, e.g. MAX_ROMLAYOUT. Dynamic allocation would be cleaner, IMHO (or just inline the decoding into the processing or the other way around).
https://review.coreboot.org/#/c/23203/5/fmap.c File fmap.c:
https://review.coreboot.org/#/c/23203/5/fmap.c@63 PS5, Line 63: fmap->ver_major = dump[i++]; overflow check?
Though, I think it would be much easier to check only two times. One time for `sizeof(struct fmap)` and one time for `nareas`.