summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2009-08-02 13:50:15 +0200
committerPhil Sutter <phil@nwl.cc>2009-08-02 15:46:20 +0200
commit6645191ee698b1a928f898b6cd90b73b98979028 (patch)
treed604ef37b1b12191da00616b655dddcb2f978c12
parent8975933179908dbff352d01018b5fbbf60d6c0d9 (diff)
drop the CONFIG_ prefixing for .config
-rw-r--r--config/confdata.c55
1 files changed, 23 insertions, 32 deletions
diff --git a/config/confdata.c b/config/confdata.c
index a04da3459..7cc195cbd 100644
--- a/config/confdata.c
+++ b/config/confdata.c
@@ -219,22 +219,20 @@ load:
sym = NULL;
switch (line[0]) {
case '#':
- if (memcmp(line + 2, "CONFIG_", 7))
- continue;
- p = strchr(line + 9, ' ');
+ p = strchr(line + 2, ' ');
if (!p)
continue;
*p++ = 0;
if (strncmp(p, "is not set", 10))
continue;
if (def == S_DEF_USER) {
- sym = sym_find(line + 9);
+ sym = sym_find(line + 2);
if (!sym) {
sym_add_change_count(1);
break;
}
} else {
- sym = sym_lookup(line + 9, 0);
+ sym = sym_lookup(line + 2, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_BOOLEAN;
}
@@ -251,12 +249,8 @@ load:
;
}
break;
- case 'C':
- if (memcmp(line, "CONFIG_", 7)) {
- conf_warning("unexpected data");
- continue;
- }
- p = strchr(line + 7, '=');
+ default:
+ p = strchr(line, '=');
if (!p)
continue;
*p++ = 0;
@@ -267,13 +261,13 @@ load:
*p2 = 0;
}
if (def == S_DEF_USER) {
- sym = sym_find(line + 7);
+ sym = sym_find(line);
if (!sym) {
sym_add_change_count(1);
break;
}
} else {
- sym = sym_lookup(line + 7, 0);
+ sym = sym_lookup(line, 0);
if (sym->type == S_UNKNOWN)
sym->type = S_OTHER;
}
@@ -286,9 +280,6 @@ load:
case '\r':
case '\n':
break;
- default:
- conf_warning("unexpected data");
- continue;
}
if (sym && sym_is_choice_value(sym)) {
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
@@ -489,19 +480,19 @@ int conf_write(const char *name)
case S_TRISTATE:
switch (sym_get_tristate_value(sym)) {
case no:
- fprintf(out, "# CONFIG_%s is not set\n", sym->name);
+ fprintf(out, "# %s is not set\n", sym->name);
break;
case mod:
- fprintf(out, "CONFIG_%s=m\n", sym->name);
+ fprintf(out, "%s=m\n", sym->name);
break;
case yes:
- fprintf(out, "CONFIG_%s=y\n", sym->name);
+ fprintf(out, "%s=y\n", sym->name);
break;
}
break;
case S_STRING:
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=\"", sym->name);
+ fprintf(out, "%s=\"", sym->name);
while (1) {
l = strcspn(str, "\"\\");
if (l) {
@@ -517,12 +508,12 @@ int conf_write(const char *name)
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out, "%s=%s\n", sym->name, str);
break;
}
case S_INT:
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out, "%s=%s\n", sym->name, str);
break;
}
}
@@ -726,19 +717,19 @@ int conf_write_autoconf(void)
case no:
break;
case mod:
- fprintf(out, "CONFIG_%s=m\n", sym->name);
- fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
+ fprintf(out, "%s=m\n", sym->name);
+ fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
break;
case yes:
- fprintf(out, "CONFIG_%s=y\n", sym->name);
- fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
+ fprintf(out, "%s=y\n", sym->name);
+ fprintf(out_h, "#define %s 1\n", sym->name);
break;
}
break;
case S_STRING:
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=\"", sym->name);
- fprintf(out_h, "#define CONFIG_%s \"", sym->name);
+ fprintf(out, "%s=\"", sym->name);
+ fprintf(out_h, "#define %s \"", sym->name);
while (1) {
l = strcspn(str, "\"\\");
if (l) {
@@ -758,14 +749,14 @@ int conf_write_autoconf(void)
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
- fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
+ fprintf(out, "%s=%s\n", sym->name, str);
+ fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
break;
}
case S_INT:
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
- fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
+ fprintf(out, "%s=%s\n", sym->name, str);
+ fprintf(out_h, "#define %s %s\n", sym->name, str);
break;
default:
break;