kconfig: Only generate config_is_xxx for bool and tristate options
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>
This commit is contained in:
parent
51f31afd12
commit
4c54f0f846
@ -798,7 +798,6 @@ int conf_write_autoconf(void)
|
|||||||
const char *name;
|
const char *name;
|
||||||
FILE *out, *tristate, *out_h;
|
FILE *out, *tristate, *out_h;
|
||||||
int i;
|
int i;
|
||||||
int fct_val;
|
|
||||||
|
|
||||||
sym_clear_all_valid();
|
sym_clear_all_valid();
|
||||||
|
|
||||||
@ -839,7 +838,7 @@ int conf_write_autoconf(void)
|
|||||||
rootmenu.prompt->text);
|
rootmenu.prompt->text);
|
||||||
|
|
||||||
for_all_symbols(i, sym) {
|
for_all_symbols(i, sym) {
|
||||||
fct_val = 1;
|
int fct_val = 0;
|
||||||
sym_calc_value(sym);
|
sym_calc_value(sym);
|
||||||
if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
|
if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
|
||||||
continue;
|
continue;
|
||||||
@ -853,7 +852,6 @@ int conf_write_autoconf(void)
|
|||||||
case S_TRISTATE:
|
case S_TRISTATE:
|
||||||
switch (sym_get_tristate_value(sym)) {
|
switch (sym_get_tristate_value(sym)) {
|
||||||
case no:
|
case no:
|
||||||
fct_val = 0;
|
|
||||||
break;
|
break;
|
||||||
case mod:
|
case mod:
|
||||||
fprintf(tristate, "%s%s=M\n",
|
fprintf(tristate, "%s%s=M\n",
|
||||||
@ -868,8 +866,10 @@ int conf_write_autoconf(void)
|
|||||||
CONFIG_, sym->name);
|
CONFIG_, sym->name);
|
||||||
fprintf(out_h, "#define %s%s 1\n",
|
fprintf(out_h, "#define %s%s 1\n",
|
||||||
CONFIG_, sym->name);
|
CONFIG_, sym->name);
|
||||||
|
fct_val = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val);
|
||||||
break;
|
break;
|
||||||
case S_STRING:
|
case S_STRING:
|
||||||
conf_write_string(true, sym->name, sym_get_string_value(sym), out_h);
|
conf_write_string(true, sym->name, sym_get_string_value(sym), out_h);
|
||||||
@ -887,10 +887,8 @@ int conf_write_autoconf(void)
|
|||||||
CONFIG_, sym->name, str);
|
CONFIG_, sym->name, str);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fct_val = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val);
|
|
||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
fclose(tristate);
|
fclose(tristate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user