On Wed, Nov 8, 2017 at 6:10 PM, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > Currently, the parsing of options is often quite ad-hoc and thus: > - need a lot of code > - is not clear at all > > Improve this by making this table driven. Please start the patch with the greatest idea table driven option parsing. Please also considering reducing the number of patches require to get to the same code. - const char *opt; - arg++; - - if ((opt = match_option(arg, "tabstop="))) - return handle_switch_ftabstop(opt, next); - if ((opt = match_option(arg, "dump-"))) - return handle_switch_fdump(opt, next); - if (opt_ullong(arg, "-fmemcpy-max-count=", &fmemcpy_max_count, - OPTNUM_ZERO_IS_INF|OPTNUM_UNLIMITED)) - return next; - - /* handle switches w/ arguments above, boolean and only boolean below */ - if (handle_simple_switch(arg, fflags)) + if (handle_switches(arg-1, arg+1, fflags)) Reviewing all those intermediate code which get overwritten at later patch is a waste of review effort, which can be spend on some other code. Splitting one patch into 10 patches does not save review effort. It causes more. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html