aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-11 08:39:40 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-21 10:49:30 -0500
commit5a3dc717b3c785242e6d40f08288947cb6751ee4 (patch)
tree764bad98a5d88c257b2cef77f1bd29751c1a852e
parent52e58a3caeba5d6029a9b6be02e4c883c22610ec (diff)
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>
-rw-r--r--scripts/kconfig/conf.c17
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 @@
20 20
21static void conf(struct menu *menu); 21static void conf(struct menu *menu);
22static void check_conf(struct menu *menu); 22static void check_conf(struct menu *menu);
23static void xfgets(char *str, int size, FILE *in);
24 23
25enum input_mode { 24enum input_mode {
26 oldaskconfig, 25 oldaskconfig,
@@ -83,6 +82,13 @@ static void check_stdin(void)
83 } 82 }
84} 83}
85 84
85/* Helper function to facilitate fgets() by Jean Sacren. */
86static void xfgets(char *str, int size, FILE *in)
87{
88 if (!fgets(str, size, in))
89 fprintf(stderr, "\nError in reading or end of file.\n");
90}
91
86static int conf_askvalue(struct symbol *sym, const char *def) 92static int conf_askvalue(struct symbol *sym, const char *def)
87{ 93{
88 enum symbol_type type = sym_get_type(sym); 94 enum symbol_type type = sym_get_type(sym);
@@ -713,12 +719,3 @@ int main(int ac, char **av)
713 } 719 }
714 return 0; 720 return 0;
715} 721}
716
717/*
718 * Helper function to facilitate fgets() by Jean Sacren.
719 */
720void xfgets(char *str, int size, FILE *in)
721{
722 if (fgets(str, size, in) == NULL)
723 fprintf(stderr, "\nError in reading or end of file.\n");
724}