From: Masahiro Yamada Date: Wed, 29 Jul 2020 03:18:37 +0000 (+0900) Subject: kconfig: add 'static' to some file-local data X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=2c7842933aa7936171c78fdb62d6d8393e28ee87;p=carl9170fw.git kconfig: add 'static' to some file-local data Fix some warnings from sparce like follows: warning: symbol '...' was not declared. Should it be static? Signed-off-by: Masahiro Yamada Signed-off-by: Christian Lamparter --- diff --git a/config/lexer.l b/config/lexer.l index 76ab3db..8b0fd8f 100644 --- a/config/lexer.l +++ b/config/lexer.l @@ -36,7 +36,7 @@ struct buffer { YY_BUFFER_STATE state; }; -struct buffer *current_buf; +static struct buffer *current_buf; static int last_ts, first_ts; diff --git a/config/symbol.c b/config/symbol.c index 9363e37..ffa3ec6 100644 --- a/config/symbol.c +++ b/config/symbol.c @@ -15,15 +15,21 @@ struct symbol symbol_yes = { .name = "y", .curr = { "y", yes }, .flags = SYMBOL_CONST|SYMBOL_VALID, -}, symbol_mod = { +}; + +struct symbol symbol_mod = { .name = "m", .curr = { "m", mod }, .flags = SYMBOL_CONST|SYMBOL_VALID, -}, symbol_no = { +}; + +struct symbol symbol_no = { .name = "n", .curr = { "n", no }, .flags = SYMBOL_CONST|SYMBOL_VALID, -}, symbol_empty = { +}; + +static struct symbol symbol_empty = { .name = "", .curr = { "", no }, .flags = SYMBOL_VALID, @@ -31,7 +37,7 @@ struct symbol symbol_yes = { struct symbol *sym_defconfig_list; struct symbol *modules_sym; -tristate modules_val; +static tristate modules_val; enum symbol_type sym_get_type(struct symbol *sym) {