See patch.
Uwe.
Am 29.07.2011 14:10 schrieb Uwe Hermann:
Cleanup flashrom.c, move functions where they belong.
The file flashrom.c is a random collection of unrelated stuff and should be refactored a bit. This is part 1 of that effort.
Does a feature or bugfix depend on this? I don't see immediate benefits of this patch, and it will break quite a few unmerged patches. If our patchwork queue was ~10 patches instead of 150 patches, the effort to update them would be manageable, but right now this is mostly making life harder for people who want to merge pending patches.
Move main() to cli_classic.c where it belongs, it's the main function of the CLI program. Other frontends/GUIs will have their own main() function.
Move programmer_table[] from flashrom.c to programmer.c where it belongs.
Move the following functions to print.c as they're purely printing related: nonfatal_help_message(), emergency_help_message(), list_programmers_linebreak(), print_sysinfo(), print_version(), and print_banner().
Drop list_programmers(), as it's never used.
list_programmers() was introduced to have a useful programmer list for libflashrom. Unless libflashrom is dead and buried, I'd like to keep it in.
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de
Regards, Carl-Daniel
On Fri, Jul 29, 2011 at 11:27:16PM +0200, Carl-Daniel Hailfinger wrote:
Am 29.07.2011 14:10 schrieb Uwe Hermann:
Cleanup flashrom.c, move functions where they belong.
The file flashrom.c is a random collection of unrelated stuff and should be refactored a bit. This is part 1 of that effort.
Does a feature or bugfix depend on this?
Only the moving of main() to cli_classic.c. As flashrom.c is part of libflashrom at the moment, it must not contain a main(). The rest is optional.
I'll post the main() moving as extra patch.
I don't see immediate benefits of this patch, and it will break quite a few unmerged patches. If our patchwork queue was ~10 patches instead of 150 patches, the effort to update them would be manageable, but right now this is mostly making life harder for people who want to merge pending patches.
Sure, we can postpone the patch until most of the conflicting pending patches are merged. Shortly after a release is the best time window for such changes though, I think, so we shouldn't wait too long. When the next release is nearer nobody will want such "move stuff" changes for sure.
- Drop list_programmers(), as it's never used.
list_programmers() was introduced to have a useful programmer list for libflashrom. Unless libflashrom is dead and buried, I'd like to keep it in.
Hm, ok, might be useful in some cases, though I think most frontends will iterate over programmer_table() themselves and print/do/generate whatever is needed.
I'll post an updated patch when a few more of the conflicting patches are merged.
Uwe.