kconfig: make conf_unsaved a local variable of conf_read()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 11 Jan 2018 13:39:41 +0000 (22:39 +0900)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 10 Feb 2019 20:53:09 +0000 (21:53 +0100)
conf_unsaved is initialized by conf_read_simple(), but it is possible
to move it to conf_read() so that it can be a local variable.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/confdata.c

index 204e751f4204f88763ab894188c0b8e934269091..2e030b4c736a2876f9a8499a5bd5f0b3939487e4 100644 (file)
@@ -28,7 +28,7 @@ static void conf_message(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
 
 static const char *conf_filename;
-static int conf_lineno, conf_warnings, conf_unsaved;
+static int conf_lineno, conf_warnings;
 
 const char conf_defname[] = "include/generated/defconfig";
 
@@ -290,7 +290,6 @@ load:
        conf_filename = name;
        conf_lineno = 0;
        conf_warnings = 0;
-       conf_unsaved = 0;
 
        def_flags = SYMBOL_DEF << def;
        for_all_symbols(i, sym) {
@@ -409,6 +408,7 @@ setsym:
 int conf_read(const char *name)
 {
        struct symbol *sym;
+       int conf_unsaved = 0;
        int i;
 
        sym_set_change_count(0);