Skip to content

Commit 4e244c1

Browse files
committed
kconfig: remove unneeded symbol_empty variable
This is used only for initializing other variables. Use the empty string "" directly. Please note newval.tri is unused for S_INT/HEX/STRING. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 0df8e97 commit 4e244c1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

scripts/kconfig/symbol.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ struct symbol symbol_no = {
2929
.flags = SYMBOL_CONST|SYMBOL_VALID,
3030
};
3131

32-
static struct symbol symbol_empty = {
33-
.name = "",
34-
.curr = { "", no },
35-
.flags = SYMBOL_VALID,
36-
};
37-
3832
struct symbol *modules_sym;
3933
static tristate modules_val;
4034

@@ -346,7 +340,7 @@ void sym_calc_value(struct symbol *sym)
346340
case S_INT:
347341
case S_HEX:
348342
case S_STRING:
349-
newval = symbol_empty.curr;
343+
newval.val = "";
350344
break;
351345
case S_BOOLEAN:
352346
case S_TRISTATE:
@@ -697,13 +691,12 @@ const char *sym_get_string_default(struct symbol *sym)
697691
{
698692
struct property *prop;
699693
struct symbol *ds;
700-
const char *str;
694+
const char *str = "";
701695
tristate val;
702696

703697
sym_calc_visibility(sym);
704698
sym_calc_value(modules_sym);
705699
val = symbol_no.curr.tri;
706-
str = symbol_empty.curr.val;
707700

708701
/* If symbol has a default value look it up */
709702
prop = sym_get_default_prop(sym);

0 commit comments

Comments
 (0)