On Wed, 30 Jul 2014 09:01:43 -0500 (CDT) Nate Case ncase@xes-inc.com wrote:
Condense 'read_it', 'write_it', 'erase_it', 'verify_it', and 'force' into a single 'flags' parameter. This makes the function signatures much more sane, while also making it much easier to add new features/flags in the future.
Signed-off-by: Nate Case ncase@xes-inc.com
Hello Nate and thanks for your patch!
We (mostly Carl-Daniel and myself) have (individually) thought about this (obvious and prominently documented) problem but have not discussed this with each other or in public.
My opinion is that it would make sense to add a new field to struct flashctx that holds various flashrom-wide options (like the action(s) to take or the force switch, but also other things). That would get rid of some other global variables as well. I am not sure about using an integer flag for that though... I'd probably rather use a new struct with bitfields instead.
(I should use less parentheses.) Anyway, before investing any time into this matter, I would like to hear what Carl-Daniel has to say about it (and anybody else too of course! Damnit, parentheses again).