From patchwork Fri Dec 3 12:23:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 377811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3CNoxh017928 for ; Fri, 3 Dec 2010 12:23:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758454Ab0LCMXu (ORCPT ); Fri, 3 Dec 2010 07:23:50 -0500 Received: from cantor.suse.de ([195.135.220.2]:34504 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755364Ab0LCMXt (ORCPT ); Fri, 3 Dec 2010 07:23:49 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 75A6C6CB00; Fri, 3 Dec 2010 13:23:48 +0100 (CET) Received: by sepie.suse.cz (Postfix, from userid 10020) id E4F6C76B8A; Fri, 3 Dec 2010 13:23:47 +0100 (CET) Date: Fri, 3 Dec 2010 13:23:47 +0100 From: Michal Marek To: Ben Hutchings Cc: Roman Zippel , linux-kbuild@vger.kernel.org, Debian kernel maintainers Subject: Re: [PATCH] Kbuild: kconfig: Verbose version of --listnewconfig Message-ID: <20101203122347.GA12395@sepie.suse.cz> References: <1290488397.6770.1404.camel@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1290488397.6770.1404.camel@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 12:23:51 +0000 (UTC) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 6d37d5c..41731c7 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -439,8 +439,6 @@ static void report_conf(struct menu *menu, bool verbose) { struct symbol *sym; struct menu *child; - int l; - const char *str; if (!menu_is_visible(menu)) return; @@ -455,49 +453,7 @@ static void report_conf(struct menu *menu, bool verbose) if (sym && (sym->flags & SYMBOL_NEW) && sym_is_changable(sym) && sym->name && !sym_is_choice_value(sym)) { if (verbose) { - switch (sym->type) { - case S_BOOLEAN: - case S_TRISTATE: - switch (sym_get_tristate_value(sym)) { - case no: - printf("# CONFIG_%s is not set\n", sym->name); - break; - case mod: - printf("CONFIG_%s=m\n", sym->name); - break; - case yes: - printf("CONFIG_%s=y\n", sym->name); - break; - } - break; - case S_STRING: - str = sym_get_string_value(sym); - printf("CONFIG_%s=\"", sym->name); - while (1) { - l = strcspn(str, "\"\\"); - if (l) { - fwrite(str, l, 1, stdout); - str += l; - } - if (!*str) - break; - printf("\\%c", *str++); - } - fputs("\"\n", stdout); - break; - case S_HEX: - str = sym_get_string_value(sym); - if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { - printf("CONFIG_%s=%s\n", sym->name, str); - break; - } - case S_INT: - str = sym_get_string_value(sym); - printf("CONFIG_%s=%s\n", sym->name, str); - break; - default: - break; - } + conf_write_symbol(sym, sym->type, stdout, true); } else { printf("CONFIG_%s\n", sym->name); } diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 44c9d62..1955b48 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -440,7 +440,7 @@ static void conf_write_string(bool headerfile, const char *name, fputs("\"\n", out); } -static void conf_write_symbol(struct symbol *sym, enum symbol_type type, +void conf_write_symbol(struct symbol *sym, enum symbol_type type, FILE *out, bool write_no) { const char *str; diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 17342fe..6da571b 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -7,6 +7,7 @@ P(conf_read_simple,int,(const char *name, int)); P(conf_write_defconfig,int,(const char *name)); P(conf_write,int,(const char *name)); P(conf_write_autoconf,int,(void)); +P(conf_write_symbol, void,(struct symbol*, enum symbol_type, FILE*, bool)); P(conf_get_changed,bool,(void)); P(conf_set_changed_callback, void,(void (*fn)(void))); P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap)));