Attention is currently required from: Anastasia Klimchuk, Dmitry Zhadinets.
Peter Marheine has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/87341?usp=email )
Change subject: libflashrom: Add probing v2 which can find all mathching chips ......................................................................
Patch Set 4:
(3 comments)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/87341/comment/28e7fbaa_60bbac2b?usp... : PS3, Line 1216: if (ret == 1) {
I mark this unresolved, because otherwise it is not shown in the latest diffs :( […]
I agree that it's worth having this branch, even if we know that the library currently never returns it.
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/87341/comment/d18be8e0_2c2bccb6?usp... : PS4, Line 312: const char **all_matched_names,
I initially tried p. […]
The tricky part is that you end up needing a three-star pointer. A sample that tripped me up initially but I can confirm does work:
``` const char *strings[] = { "foo", "bar", };
int fetch_strings(const char ***sa) { int out = sizeof(strings) / sizeof(*strings); const char **outp = calloc(sizeof(strings) / sizeof(*strings), sizeof(const char*)); for (int i = 0; i < out; i++) { outp[i] = strings[i]; } *sa = outp; return out; } ```
https://review.coreboot.org/c/flashrom/+/87341/comment/63207ee7_0bb82129?usp... : PS4, Line 313: unsigned int *all_matched_count,
That's an interesting idea! I also like to have one less parameter. […]
Yeah, I think changing the meaning of the return value is fine since this also changes the entire function signature.