Attention is currently required from: Dmitry Zhadinets, Peter Marheine.
Anastasia Klimchuk 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/1f89c545_a671a4e3?usp... : PS3, Line 1216: if (ret == 1) {
A comment here is that: probing never returns 1, and v1 probing never returned 1 either. […]
I mark this unresolved, because otherwise it is not shown in the latest diffs :(
but mostly this is to ask what people think about it.
Even if there will be changes to probe_flash, that's not for this commit.
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/87341/comment/4646ffed_6b038800?usp... : PS4, Line 312: const char **all_matched_names,
I see from the implementation that the caller is expected to allocate this buffer, but that's not cl […]
I initially tried p.2 too! :) but from my memory I got stuck because chip name is const and it did not allow copying into non-const array. And I couldn't pass const array into function if I were to allocate memory for it... it was something like that. The other APIs return the allocated array rather than taking it as param.
I can try again, in case I missed something. But possibly that p.2 needs to return array of names (I like more the idea to return the number of matches. as you suggested in other comment)
https://review.coreboot.org/c/flashrom/+/87341/comment/cae28c49_4a4384f1?usp... : PS4, Line 313: unsigned int *all_matched_count,
I'd say it's more conventional to use negative values for error and positive values for success when […]
That's an interesting idea! I also like to have one less parameter. The only thing to double-check: my initial version was keeping the same convention for return codes as it was in probing v1. This idea will change it (especially that 0 no longer indicates success). So you think it's fine?