Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/45230 )
Change subject: dummyflasher.c: Factor out global state ......................................................................
Patch Set 1:
(3 comments)
https://review.coreboot.org/c/flashrom/+/45230/1/dummyflasher.c File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/45230/1/dummyflasher.c@175 PS1, Line 175: data->emu_chip = EMULATE_NONE; This will trigger undefined behavior if `data` is null. Moreover, some compilers will happily optimize out the null check right below because of this. See the second example from here: https://lwn.net/Articles/575563
https://review.coreboot.org/c/flashrom/+/45230/1/dummyflasher.c@467 PS1, Line 467: { These braces weren't here before
https://review.coreboot.org/c/flashrom/+/45230/1/dummyflasher.c@542 PS1, Line 542: emu_data This was named `data` in `dummy_init`, why use a different name for the same thing here?