diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-01-11 22:39:40 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-01-22 00:49:30 +0900 |
commit | 5a3dc717b3c785242e6d40f08288947cb6751ee4 (patch) | |
tree | 764bad98a5d88c257b2cef77f1bd29751c1a852e /scripts/kconfig/conf.c | |
parent | 52e58a3caeba5d6029a9b6be02e4c883c22610ec (diff) | |
download | linux-stable-5a3dc717b3c785242e6d40f08288947cb6751ee4.tar.gz linux-stable-5a3dc717b3c785242e6d40f08288947cb6751ee4.tar.bz2 linux-stable-5a3dc717b3c785242e6d40f08288947cb6751ee4.zip |
kconfig: make xfgets() really static
Sparse reports:
warning: symbol 'xfgets' was not declared. Should it be static?
It is declared as static, but it is missing in the definition part.
Move the definition up and remove the forward declaration.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r-- | scripts/kconfig/conf.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 26156cb38ba0..a8a97efd3dfc 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -20,7 +20,6 @@ static void conf(struct menu *menu); static void check_conf(struct menu *menu); -static void xfgets(char *str, int size, FILE *in); enum input_mode { oldaskconfig, @@ -83,6 +82,13 @@ static void check_stdin(void) } } +/* Helper function to facilitate fgets() by Jean Sacren. */ +static void xfgets(char *str, int size, FILE *in) +{ + if (!fgets(str, size, in)) + fprintf(stderr, "\nError in reading or end of file.\n"); +} + static int conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); @@ -713,12 +719,3 @@ int main(int ac, char **av) } return 0; } - -/* - * Helper function to facilitate fgets() by Jean Sacren. - */ -void xfgets(char *str, int size, FILE *in) -{ - if (fgets(str, size, in) == NULL) - fprintf(stderr, "\nError in reading or end of file.\n"); -} |