Attention is currently required from: Anastasia Klimchuk, Richard Hughes, Sergii Dmytruk.
Peter Marheine has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback ......................................................................
Patch Set 9:
(1 comment)
File include/flash.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/206931c0_9fd7b81d?usp... : PS8, Line 624: flashrom_progress_callback_v2 *progress_callback; : struct flashrom_progress progress_state; : struct stage_progress stage_progress[FLASHROM_PROGRESS_NR]; : /* deprecated, do not use */ : flashrom_progress_callback *deprecated_progress_callback; : struct flashrom_progress *deprecated_progress_state;
There is one important detail in current implementation which I think won't work with the union. […]
That makes sense, but I think that means the old function is currently inconsistent in its behavior because it's sensitive to the order in which callbacks are initialized: doing the old one first will register both, but the new one first will only register the new one. It's plausible that a library user might mix the old and new APIs on a single flash context, where it would be confusing to be sensitive to initialization order.
I think either mixing them should be forbidden, or `flashrom_set_progress_callback` needs to always work.