projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kconfig: make input_mode static
[carl9170fw.git]
/
config
/
confdata.c
diff --git
a/config/confdata.c
b/config/confdata.c
index 8128254a6265626e1f89efdec27d6ea06b830ea1..204e751f4204f88763ab894188c0b8e934269091 100644
(file)
--- a/
config/confdata.c
+++ b/
config/confdata.c
@@
-16,6
+16,11
@@
#include "lkc.h"
#include "lkc.h"
+struct conf_printer {
+ void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
+ void (*print_comment)(FILE *, const char *, void *);
+};
+
static void conf_warning(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
static void conf_warning(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
@@
-59,6
+64,7
@@
static void conf_message(const char *fmt, ...)
va_start(ap, fmt);
if (conf_message_callback)
conf_message_callback(fmt, ap);
va_start(ap, fmt);
if (conf_message_callback)
conf_message_callback(fmt, ap);
+ va_end(ap);
}
const char *conf_get_configname(void)
}
const char *conf_get_configname(void)
@@
-140,7
+146,9
@@
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
sym->flags |= def_flags;
break;
}
sym->flags |= def_flags;
break;
}
- conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+ if (def != S_DEF_AUTO)
+ conf_warning("symbol value '%s' invalid for %s",
+ p, sym->name);
return 1;
case S_OTHER:
if (*p != '"') {
return 1;
case S_OTHER:
if (*p != '"') {
@@
-161,7
+169,8
@@
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
memmove(p2, p2 + 1, strlen(p2));
}
if (!p2) {
memmove(p2, p2 + 1, strlen(p2));
}
if (!p2) {
- conf_warning("invalid string found");
+ if (def != S_DEF_AUTO)
+ conf_warning("invalid string found");
return 1;
}
/* fall through */
return 1;
}
/* fall through */
@@
-172,7
+181,9
@@
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
sym->def[def].val = strdup(p);
sym->flags |= def_flags;
} else {
sym->def[def].val = strdup(p);
sym->flags |= def_flags;
} else {
- conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+ if (def != S_DEF_AUTO)
+ conf_warning("symbol value '%s' invalid for %s",
+ p, sym->name);
return 1;
}
break;
return 1;
}
break;
@@
-256,11
+267,8
@@
int conf_read_simple(const char *name, int def)
if (in)
goto load;
sym_add_change_count(1);
if (in)
goto load;
sym_add_change_count(1);
- if (!sym_defconfig_list) {
- if (modules_sym)
- sym_calc_value(modules_sym);
+ if (!sym_defconfig_list)
return 1;
return 1;
- }
for_all_defaults(sym_defconfig_list, prop) {
if (expr_calc_value(prop->visible.expr) == no ||
for_all_defaults(sym_defconfig_list, prop) {
if (expr_calc_value(prop->visible.expr) == no ||
@@
-367,7
+375,9
@@
load:
continue;
} else {
if (line[0] != '\r' && line[0] != '\n')
continue;
} else {
if (line[0] != '\r' && line[0] != '\n')
- conf_warning("unexpected data");
+ conf_warning("unexpected data: %.*s",
+ (int)strcspn(line, "\r\n"), line);
+
continue;
}
setsym:
continue;
}
setsym:
@@
-393,9
+403,6
@@
setsym:
}
free(line);
fclose(in);
}
free(line);
fclose(in);
-
- if (modules_sym)
- sym_calc_value(modules_sym);
return 0;
}
return 0;
}
@@
-406,8
+413,12
@@
int conf_read(const char *name)
sym_set_change_count(0);
sym_set_change_count(0);
- if (conf_read_simple(name, S_DEF_USER))
+ if (conf_read_simple(name, S_DEF_USER)) {
+ sym_calc_value(modules_sym);
return 1;
return 1;
+ }
+
+ sym_calc_value(modules_sym);
for_all_symbols(i, sym) {
sym_calc_value(sym);
for_all_symbols(i, sym) {
sym_calc_value(sym);
@@
-884,6
+895,7
@@
static int conf_split_config(void)
name = conf_get_autoconfig_name();
conf_read_simple(name, S_DEF_AUTO);
name = conf_get_autoconfig_name();
conf_read_simple(name, S_DEF_AUTO);
+ sym_calc_value(modules_sym);
if (chdir("include/generated"))
return 1;
if (chdir("include/generated"))
return 1;
@@
-1174,7
+1186,7
@@
void set_all_choice_values(struct symbol *csym)
bool conf_set_all_new_symbols(enum conf_def_mode mode)
{
struct symbol *sym, *csym;
bool conf_set_all_new_symbols(enum conf_def_mode mode)
{
struct symbol *sym, *csym;
- int i, cnt, pby, pty, ptm; /* pby: probability of bool
ean
= y
+ int i, cnt, pby, pty, ptm; /* pby: probability of bool
= y
* pty: probability of tristate = y
* ptm: probability of tristate = m
*/
* pty: probability of tristate = y
* ptm: probability of tristate = m
*/
@@
-1236,7
+1248,10
@@
bool conf_set_all_new_symbols(enum conf_def_mode mode)
sym->def[S_DEF_USER].tri = mod;
break;
case def_no:
sym->def[S_DEF_USER].tri = mod;
break;
case def_no:
- sym->def[S_DEF_USER].tri = no;
+ if (sym->flags & SYMBOL_ALLNOCONFIG_Y)
+ sym->def[S_DEF_USER].tri = yes;
+ else
+ sym->def[S_DEF_USER].tri = no;
break;
case def_random:
sym->def[S_DEF_USER].tri = no;
break;
case def_random:
sym->def[S_DEF_USER].tri = no;