Attention is currently required from: Edward O'Callaghan, Alexander Goncharov.
3 comments:
File dummyflasher.c:
Patch Set #2, Line 79: uint8_t refs_cnt;
Can you add a comment on this: to explain that dummyflasher can register multiple masters and they all share the same emu_data, so keeping track of reference count is needed to do clean up at shutdown time.
the last owner of the data must release this data
yeah that's a good argument, let's keep it. I mark resolved
data->refs_cnt += ((dummy_buses_supported & BUS_PROG) != BUS_NONE);
data->refs_cnt += ((dummy_buses_supported & BUS_NONSPI) != BUS_NONE);
data->refs_cnt += ((dummy_buses_supported & BUS_SPI) != BUS_NONE);
#if 0
data->refs_cnt += (dummy_buses_supported & BUS_PROG) ? 1 : 0;
data->refs_cnt += (dummy_buses_supported & BUS_NONSPI) ? 1 : 0;
data->refs_cnt += (dummy_buses_supported & BUS_SPI) ? 1 : 0;
#endif
Which one is more appropriate?
I have another idea! :) What if you add `refs_cnt++` into every if below. There are the same three if conditions below, already here.
To view, visit change 72408. To unsubscribe, or for help writing mail filters, visit settings.