[flashrom] [PATCH] Clean up doit()

Sean Nelson audiohacked at gmail.com
Fri Oct 15 01:44:54 CEST 2010


  On 10/14/10 1:57 PM, Carl-Daniel Hailfinger wrote:
> doit() is the monster function we split off from main() when we created
> cli_classic() and tried to introduce some abstraction. doit() is a
> poster child of WTFs on an astronomic scale.
>
> Make doit() marginally less bad by factoring out self-contained code.
>
> Create read_bug_from_file() and chip_safety_check() functions
>
> The new code flow is designed to make partial writes easier to implement
> and to reduce eye bleeding if someone is looking at the code.
>
> Tests appreciated.
>
> Signed-off-by: Carl-Daniel Hailfinger<c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Sean Nelson <audiohacked at gmail.com>





More information about the flashrom mailing list