Re: [PATCH 1/1] kconfig: Add a configuration subtree command to kconfig
Arnaud Lacombe <[email protected]> Sat, 19 Nov 2011 01:15:50 -0500
| Newsgroups | org.kernel.vger.linux-config,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CACqU3MXPWvfThDmLMrK+ne+_hDXOU=atJpC98hUHL04DXUPAxw@mail.gmail.com> |
Hi, On Fri, Nov 18, 2011 at 9:16 AM, Konrad Eisele <[email protected]> wro= te: > New kconfig command "subsource": > subsource "<kconfig>" "<cwd>" "<.config>" "<title>" =A0<internal_pref= ix> <.config_prefix> > Allocates <kconfig> as a configuration subtree using <.config> as the= configuration > file to save and load from. <cwd> is the directory path to switch to = for "source" to > work, "<title>" is the Menu tile of the subtree, <internal_prefix> is= a internal prefix, > and <.config_prefix> is the prefix to append/remove when saving/loadi= ng <.config>. > Please break this down in logical change! There is very good stuff in this patch but it need to be digested slowl= y :) I'd see it as: - introduce the config structure - convert all globals reference to use structure members - get rid of these `_level' prefix and NULL pointer passing. - then introduce the subsource logic (and please separate parser update and regen of shipped file) There is no need for the `_level' prefixing, NULL pointer passing, and conditionally select the structure or the global. The sub-tree should be treated the same way as the global tree. Basically: - if (!sym_defconfig_list) { + if (!(l ? l->sym_defconfig_list : sym_defconfig_list)) { should just be: - if (!sym_defconfig_list) { + if (!l->sym_defconfig_list) { no extra complexity/un-maintainability. You may not even need to change function prototypes if the current tree never expect to use anything but `current_config'. On a performance p.o.v., you may want to have one commit caching the prefix length, to avoid all the strlen(...). on a pure stylistic side - don't pass 0 when you mean NULL (well, you will no longer need that = actually) - loop with 6 level of indentation are hideous, especially for condition where you can just `break;' early Thanks, - Arnaud > Signed-off-by: Konrad Eisele <[email protected]> > --- > =A0scripts/kconfig/conf.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A06 +- > =A0scripts/kconfig/confdata.c =A0 =A0 =A0 =A0 =A0 | =A0 83 ++- > =A0scripts/kconfig/expr.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 16 + > =A0scripts/kconfig/gconf.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 + > =A0scripts/kconfig/lkc.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A01 + > =A0scripts/kconfig/lkc_proto.h =A0 =A0 =A0 =A0 =A0| =A0 12 +- > =A0scripts/kconfig/mconf.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 13 +- > =A0scripts/kconfig/menu.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 18 +- > =A0scripts/kconfig/nconf.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 13 +- > =A0scripts/kconfig/qconf.cc =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 + > =A0scripts/kconfig/symbol.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 50 ++- > =A0scripts/kconfig/util.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 49 ++ > =A0scripts/kconfig/zconf.gperf =A0 =A0 =A0 =A0 =A0| =A0 =A01 + > =A0scripts/kconfig/zconf.hash.c_shipped | =A0252 +++++----- > =A0scripts/kconfig/zconf.l =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 50 ++- > =A0scripts/kconfig/zconf.lex.c_shipped =A0| =A0 52 ++- > =A0scripts/kconfig/zconf.tab.c_shipped =A0| =A0985 ++++++++++++++++++= ---------------- > =A0scripts/kconfig/zconf.y =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 23 +- > =A018 files changed, 991 insertions(+), 639 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-config"= in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html