Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons. Anastasia Klimchuk 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:
(2 comments)
Patchset:
PS1: I have a message to reviewers, below. Thank you!
File usbblaster_spi.c:
https://review.coreboot.org/c/flashrom/+/54044/comment/9fd99056_b7c7b4a7 PS1, Line 165: static int usbblaster_shutdown(void *data) : { : free(data); : return 0; : } My own comment on this. I fully realise this patch is doing two things (removes global state and introduces shutdown function), spent some time thinking about it and decided this is the least of evil. Without shutdown function there is no way to free the spi data, so it seems relevant here (vs adding empty shutdown function in a separate patch which serves no purpose).
Also usbblaster is doing neither cleanup on init failure nor cleanup on shutdown, but this definitely should go to a separate patch. Here I only free what I allocated myself.
In any case, if people think this should be changed/split, I can do it.