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 Hailfingerc-d.hailfinger.devel.2006@gmx.net
Acked-by: Sean Nelson audiohacked@gmail.com