[flashrom] [PATCH] Clean up action parameter handling

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Wed Jul 30 17:19:32 CEST 2014


On Wed, 30 Jul 2014 09:01:43 -0500 (CDT)
Nate Case <ncase at 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 at 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).

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list