public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: Arnaud Lacombe <lacombar@gmail.com>, Ben Hutchings <ben@decadent.org.uk>
Subject: [PATCH 2/2] [RFC] kconfig/listnewconfig: show default value of new symbel
Date: Sun,  5 Dec 2010 01:35:19 -0500	[thread overview]
Message-ID: <1291530919-5601-2-git-send-email-lacombar@gmail.com> (raw)
In-Reply-To: <1291530919-5601-1-git-send-email-lacombar@gmail.com>

note: I would not mind adding the KCONFIG_VERBOSE logic.

Original idea and implementation by Bastian Blank <waldi@debian.org>,
Maximilian Attems <max@stro.at> and Ben Hutchings <ben@decadent.org.uk>

CC: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 scripts/kconfig/conf.c     |   14 +++++++++++++-
 scripts/kconfig/confdata.c |    4 ++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 5459a38..1b58129 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -411,6 +411,17 @@ conf_childs:
 		indent -= 2;
 }
 
+
+static void
+listnewconfig_print_symbol(FILE *fp, struct symbol *sym, const char *val, void *arg)
+{
+	fprintf(fp, "%s%s (default: %s)\n", CONFIG_, sym->name, val);
+}
+
+static struct conf_printer listnewconfig_printers = {
+	.print_symbol = listnewconfig_print_symbol,
+};
+
 static void check_conf(struct menu *menu)
 {
 	struct symbol *sym;
@@ -425,7 +436,8 @@ static void check_conf(struct menu *menu)
 		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
 			if (input_mode == listnewconfig) {
 				if (sym->name && !sym_is_choice_value(sym)) {
-					printf("%s%s\n", CONFIG_, sym->name);
+					conf_write_symbol(stdout, sym,
+					    &listnewconfig_printers, NULL);
 				}
 			} else if (input_mode != oldnoconfig) {
 				if (!conf_cnt++)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 31d06da..6f2f3a4 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -548,8 +548,8 @@ static struct conf_printer tristate_printer_cb =
  *
  */
 
-static void conf_write_symbol(FILE *fp, struct symbol *sym,
-			      struct conf_printer *printer, void *printer_arg)
+void conf_write_symbol(FILE *fp, struct symbol *sym,
+		       struct conf_printer *printer, void *printer_arg)
 {
 	const char *str;
 
-- 
1.7.2.30.gc37d7.dirty


  reply	other threads:[~2010-12-05  6:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05  6:35 [PATCH 1/2] [RFC] kconfig: introduce specialized printer Arnaud Lacombe
2010-12-05  6:35 ` Arnaud Lacombe [this message]
2010-12-15  6:28   ` [PATCH 2/2] [RFC] kconfig/listnewconfig: show default value of new symbel Arnaud Lacombe
2010-12-21 16:47   ` Michal Marek
2010-12-21 17:54     ` Arnaud Lacombe
2010-12-22  4:44     ` Ben Hutchings
2010-12-22  5:39       ` Arnaud Lacombe
2010-12-15  6:27 ` [PATCH 1/2] [RFC] kconfig: introduce specialized printer Arnaud Lacombe
2010-12-21 16:37 ` Michal Marek
2010-12-21 16:42   ` Arnaud Lacombe
2011-05-16  3:42   ` [PATCHv2] " Arnaud Lacombe
2011-05-31  1:26     ` Arnaud Lacombe
2011-06-08  5:08       ` Arnaud Lacombe
2011-06-09 13:01     ` Michal Marek
2011-07-01 14:51       ` Michal Marek
2011-07-07  1:34       ` Arnaud Lacombe
2011-07-08 17:01         ` Sam Ravnborg

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=1291530919-5601-2-git-send-email-lacombar@gmail.com \
    --to=lacombar@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=linux-kbuild@vger.kernel.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