Attention is currently required from: Nico Huber. 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)
File usbblaster_spi.c:
https://review.coreboot.org/c/flashrom/+/54044/comment/f384c34a_eba322bf PS1, Line 55: struct ftdi_context ftdic;
Having a struct with only one member looks odd, but it makes sense for consistency with other progra […]
Oh I had the same question in CB:52774 and I explained why I am doing this (in short, mostly so that I can calloc and free data). But I wrote a much longer comment in CB:52774 , you are very welcome to read all that :)
https://review.coreboot.org/c/flashrom/+/54044/comment/0bf389c6_806eb73d PS1, Line 185: struct ftdi_context ftdic;
We could allocate `usbblaster_data` early and use `usbblaster_data->ftdic` instead of having a secon […]
I usually try to allocate data as late as possible to simplify error paths (as soon as you allocate data, you need to take care to free it for all error paths after that). So it was intentional, can I leave it? what do you think?