Skip to content

Commit 102a1a7

Browse files
committed
kconfig: remove dead code in conf_askvalue()
conf_askvalue() is only called for oldconfig, syncconfig, and oldaskconfig. If it is called for other cases, it is a bug. So, the code after the switch statement is unreachable. Remove the dead code, and clean up the switch statement. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent a4cff32 commit 102a1a7

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

scripts/kconfig/conf.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ static void xfgets(char *str, int size, FILE *in)
8484

8585
static int conf_askvalue(struct symbol *sym, const char *def)
8686
{
87-
enum symbol_type type = sym_get_type(sym);
88-
8987
if (!sym_has_value(sym))
9088
printf("(NEW) ");
9189

@@ -107,24 +105,12 @@ static int conf_askvalue(struct symbol *sym, const char *def)
107105
return 0;
108106
}
109107
/* fall through */
110-
case oldaskconfig:
108+
default:
111109
fflush(stdout);
112110
xfgets(line, sizeof(line), stdin);
113-
return 1;
114-
default:
115111
break;
116112
}
117113

118-
switch (type) {
119-
case S_INT:
120-
case S_HEX:
121-
case S_STRING:
122-
printf("%s\n", def);
123-
return 1;
124-
default:
125-
;
126-
}
127-
printf("%s", line);
128114
return 1;
129115
}
130116

0 commit comments

Comments
 (0)