Attention is currently required from: Nico Huber, Anastasia Klimchuk. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54044 )
Change subject: usbblaster_spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 1: Code-Review+2
(3 comments)
File usbblaster_spi.c:
https://review.coreboot.org/c/flashrom/+/54044/comment/d203e14c_eb4938d8 PS1, Line 55: struct ftdi_context ftdic; Having a struct with only one member looks odd, but it makes sense for consistency with other programmers.
(No action needed)
https://review.coreboot.org/c/flashrom/+/54044/comment/9275999f_04022c25 PS1, Line 165: static int usbblaster_shutdown(void *data) : { : free(data); : return 0; : }
Seems fine to me. […]
Makes sense. This patch changes programmer context storage from a global variable to dynamically-allocated memory, and one needs to free() this memory to avoid memory leaks. Adding a shutdown function to do this is a very reasonable thing to do.
https://review.coreboot.org/c/flashrom/+/54044/comment/c6a69f1c_77219d65 PS1, Line 185: struct ftdi_context ftdic; We could allocate `usbblaster_data` early and use `usbblaster_data->ftdic` instead of having a second local variable. Can be done in a separate patch.