From: "konrad.gaisler" <konrad@gaisler.com>
To: Arnaud Lacombe <lacombar@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-config@vger.kernel.org,
mmarek@suse.cz, pefoley2@verizon.net,
yann.morin.1998@anciens.enib.fr, sam@ravnborg.org,
zippel@linux-m68k.org
Subject: Re: [PATCH 1/1] kconfig: Add a configuration subtree command to kconfig
Date: Sat, 19 Nov 2011 08:55:54 +0100 [thread overview]
Message-ID: <4EC7610A.3040807@gaisler.com> (raw)
In-Reply-To: <CACqU3MXPWvfThDmLMrK+ne+_hDXOU=atJpC98hUHL04DXUPAxw@mail.gmail.com>
On 11/19/2011 07:15 AM, Arnaud Lacombe wrote:
> Hi,
>
> On Fri, Nov 18, 2011 at 9:16 AM, Konrad Eisele<konrad@gaisler.com> wrote:
>> New kconfig command "subsource":
>> subsource "<kconfig>""<cwd>""<.config>""<title>"<internal_prefix> <.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/loading<.config>.
>>
> Please break this down in logical change!
>
> There is very good stuff in this patch but it need to be digested slowly :)
>
> 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
I'll prepare a new patch next week with your suggestion. Its
nice to hear that there is some interest in this.
-- Konrad
>
> Thanks,
> - Arnaud
>
>> Signed-off-by: Konrad Eisele<konrad@gaisler.com>
>> ---
>> scripts/kconfig/conf.c | 6 +-
>> scripts/kconfig/confdata.c | 83 ++-
>> scripts/kconfig/expr.h | 16 +
>> scripts/kconfig/gconf.c | 3 +
>> scripts/kconfig/lkc.h | 1 +
>> scripts/kconfig/lkc_proto.h | 12 +-
>> scripts/kconfig/mconf.c | 13 +-
>> scripts/kconfig/menu.c | 18 +-
>> scripts/kconfig/nconf.c | 13 +-
>> scripts/kconfig/qconf.cc | 3 +
>> scripts/kconfig/symbol.c | 50 ++-
>> scripts/kconfig/util.c | 49 ++
>> scripts/kconfig/zconf.gperf | 1 +
>> scripts/kconfig/zconf.hash.c_shipped | 252 +++++-----
>> scripts/kconfig/zconf.l | 50 ++-
>> scripts/kconfig/zconf.lex.c_shipped | 52 ++-
>> scripts/kconfig/zconf.tab.c_shipped | 985 ++++++++++++++++++----------------
>> scripts/kconfig/zconf.y | 23 +-
>> 18 files changed, 991 insertions(+), 639 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>
next prev parent reply other threads:[~2011-11-19 7:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 14:16 [PATCH 1/1] kconfig: Add a configuration subtree command to kconfig Konrad Eisele
2011-11-19 6:15 ` Arnaud Lacombe
2011-11-19 7:55 ` konrad.gaisler [this message]
2011-11-22 14:03 ` [PATCH 0/3] intro Konrad Eisele
2011-11-22 14:16 ` Konrad Eisele
2011-11-22 14:03 ` [PATCH 1/3] kconfig: Move global elements into struct, create root context Konrad Eisele
2011-11-22 14:03 ` [PATCH 2/3] kconfig: Add support for Kconfig subtrees Konrad Eisele
2011-11-22 14:03 ` [PATCH 3/3] kconfig: gconfig save button should be greyed if no changes present Konrad Eisele
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EC7610A.3040807@gaisler.com \
--to=konrad@gaisler.com \
--cc=lacombar@gmail.com \
--cc=linux-config@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=pefoley2@verizon.net \
--cc=sam@ravnborg.org \
--cc=yann.morin.1998@anciens.enib.fr \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).