diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-08-03 19:47:34 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-08-03 20:03:35 +0200 |
commit | 2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5 (patch) | |
tree | 43bc0a7953f008fad5fbc793e8d2dfca2e540081 /scripts/config/confdata.c | |
parent | 7bf3695b0230d4cc4b6348f7c87b3c164314db8d (diff) | |
download | mtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.zip mtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.gz mtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.bz2 |
scripts/config: sync with latest linux upstream
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/config/confdata.c')
-rw-r--r-- | scripts/config/confdata.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/scripts/config/confdata.c b/scripts/config/confdata.c index 052347c..3a3a4bf 100644 --- a/scripts/config/confdata.c +++ b/scripts/config/confdata.c @@ -16,6 +16,11 @@ #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))); @@ -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_end(ap); } const char *conf_get_configname(void) @@ -286,11 +292,8 @@ int conf_read_simple(const char *name, int def) 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; - } for_all_defaults(sym_defconfig_list, prop) { if (expr_calc_value(prop->visible.expr) == no || @@ -375,7 +378,9 @@ load: 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: @@ -401,9 +406,6 @@ setsym: } free(line); fclose(in); - - if (modules_sym) - sym_calc_value(modules_sym); return 0; } @@ -414,8 +416,12 @@ int conf_read(const char *name) 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; + } + + sym_calc_value(modules_sym); for_all_symbols(i, sym) { sym_calc_value(sym); @@ -846,6 +852,7 @@ static int conf_split_config(void) name = conf_get_autoconfig_name(); conf_read_simple(name, S_DEF_AUTO); + sym_calc_value(modules_sym); if (chdir("include/config")) return 1; |