linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kconfig: Only generate config_is_xxx for bool and tristate options
@ 2011-05-17 15:35 Michal Marek
  2011-05-17 18:05 ` Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Michal Marek @ 2011-05-17 15:35 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Jean-Christophe PLAGNIOL-VILLARD

For strings and integers, the config_is_xxx macros are useless and
sometimes misleading:

  #define CONFIG_INITRAMFS_SOURCE ""
  #define config_is_initramfs_source() 1

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/kconfig/confdata.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index db06af0..d40195d 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -808,7 +808,6 @@ int conf_write_autoconf(void)
 	const char *name;
 	FILE *out, *tristate, *out_h;
 	int i;
-	int fct_val;
 
 	sym_clear_all_valid();
 
@@ -849,7 +848,7 @@ int conf_write_autoconf(void)
 		       rootmenu.prompt->text);
 
 	for_all_symbols(i, sym) {
-		fct_val = 1;
+		int fct_val = 0;
 		sym_calc_value(sym);
 		if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
 			continue;
@@ -863,7 +862,6 @@ int conf_write_autoconf(void)
 		case S_TRISTATE:
 			switch (sym_get_tristate_value(sym)) {
 			case no:
-				fct_val = 0;
 				break;
 			case mod:
 				fprintf(tristate, "%s%s=M\n",
@@ -878,8 +876,10 @@ int conf_write_autoconf(void)
 					    CONFIG_, sym->name);
 				fprintf(out_h, "#define %s%s 1\n",
 				    CONFIG_, sym->name);
+				fct_val = 1;
 				break;
 			}
+			conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val);
 			break;
 		case S_STRING:
 			conf_write_string(true, sym->name, sym_get_string_value(sym), out_h);
@@ -897,10 +897,8 @@ int conf_write_autoconf(void)
 			    CONFIG_, sym->name, str);
 			break;
 		default:
-			fct_val = 0;
 			break;
 		}
-		conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val);
 	}
 	fclose(out);
 	fclose(tristate);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2011-08-02 19:33 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 15:35 [PATCH] kconfig: Only generate config_is_xxx for bool and tristate options Michal Marek
2011-05-17 18:05 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-17 19:44   ` Michal Marek
2011-05-17 19:53 ` Sam Ravnborg
2011-05-18  5:16   ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-18  6:19     ` Sam Ravnborg
2011-05-18  6:27       ` Arnaud Lacombe
2011-05-18  6:23   ` Arnaud Lacombe
2011-07-13 13:22     ` Michal Marek
2011-07-13 15:20       ` Arnaud Lacombe
2011-07-13 20:08       ` Sam Ravnborg
2011-07-19 13:45         ` Michal Marek
2011-07-25 22:58       ` [RFC][PATCH 1/2] kconfig: Introduce KCONFIG(), KCONFIG_BUILTIN() and KCONFIG_MODULE() Michal Marek
2011-07-25 22:58         ` [RFC][PATCH 2/2] mm: Switch NUMA_BUILD and COMPACTION_BUILD to new KCONFIG() syntax Michal Marek
2011-07-26 15:19           ` Michal Hocko
2011-07-26 18:34             ` Michal Marek
2011-07-26 18:52               ` Michal Hocko
2011-07-26 13:01         ` [RFC][PATCH 1/2] kconfig: Introduce KCONFIG(), KCONFIG_BUILTIN() and KCONFIG_MODULE() Américo Wang
2011-07-26 13:21           ` Michal Marek
2011-07-26 15:04             ` Randy Dunlap
2011-07-26 18:28               ` Michal Marek
2011-07-26 18:28                 ` Randy Dunlap
2011-07-26 18:48                   ` Arnaud Lacombe
2011-07-27  0:42                     ` Arnaud Lacombe
2011-07-27  4:35                       ` Randy Dunlap
2011-07-27  8:36                         ` Michal Marek
2011-07-27 13:31                           ` Arnaud Lacombe
2011-07-27 13:38                             ` Michal Marek
2011-07-27 15:11                               ` Arnaud Lacombe
2011-07-27 15:18                                 ` Michal Marek
2011-07-27 16:36                           ` Américo Wang
2011-07-27 15:09         ` Arnaud Lacombe
2011-07-27 15:16           ` Michal Marek
2011-07-27 15:18             ` Arnaud Lacombe
2011-07-29 13:51         ` [PATCH] kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE() Michal Marek
2011-07-29 17:43           ` Arnaud Lacombe
2011-07-29 18:25           ` Randy Dunlap
2011-07-29 18:58             ` Arnaud Lacombe
2011-08-02 17:33           ` Sam Ravnborg
2011-08-02 17:50             ` Arnaud Lacombe
2011-08-02 19:26               ` Sam Ravnborg
2011-08-02 19:33                 ` Michal Marek
2011-08-02 19:33                   ` Arnaud Lacombe
2011-05-25 13:35 ` [PATCH] kconfig: Only generate config_is_xxx for bool and tristate options Michal Marek

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).