On 8/9/09 4:03 PM, Carl-Daniel Hailfinger wrote:
Well, this is the same mechanism we use for ft2232_spi.c and back then it was picked because it allowed us to avoid lots of ifdefs in generic code. We'd need an ifdef in option parsing, an ifdef in the programmer struct, an ifdef in the programmer enum, etc. With all those ifdefs, it gets easy to miss one. Plus, we'd need to use #ifdef for the flashrom usage message, the --list-supported parameter
Which would be a clean way of doing it, otherwise we end up with a list of programmers in the code that are not at all supported.
The size benefits of not compiling serprog.c at all are ~256 bytes.
I am not worried about the size but about dead code being compiled into a mission critical program.
Stefan