public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kconfig: remove unneeded symbol_empty variable
@ 2023-11-25 16:35 Masahiro Yamada
  2023-11-25 16:35 ` [PATCH 2/2] kconfig: default to zero if int/hex symbol lacks default property Masahiro Yamada
  2024-01-23 12:54 ` [PATCH 1/2] kconfig: remove unneeded symbol_empty variable Geert Uytterhoeven
  0 siblings, 2 replies; 13+ messages in thread
From: Masahiro Yamada @ 2023-11-25 16:35 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This is used only for initializing other variables.

Use the empty string "".

Please note newval.tri is unused for S_INT/HEX/STRING.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/symbol.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index a76925b46ce6..f7075d148ac7 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -29,12 +29,6 @@ struct symbol symbol_no = {
 	.flags = SYMBOL_CONST|SYMBOL_VALID,
 };
 
-static struct symbol symbol_empty = {
-	.name = "",
-	.curr = { "", no },
-	.flags = SYMBOL_VALID,
-};
-
 struct symbol *modules_sym;
 static tristate modules_val;
 
@@ -346,7 +340,7 @@ void sym_calc_value(struct symbol *sym)
 	case S_INT:
 	case S_HEX:
 	case S_STRING:
-		newval = symbol_empty.curr;
+		newval.val = "";
 		break;
 	case S_BOOLEAN:
 	case S_TRISTATE:
@@ -697,13 +691,12 @@ const char *sym_get_string_default(struct symbol *sym)
 {
 	struct property *prop;
 	struct symbol *ds;
-	const char *str;
+	const char *str = "";
 	tristate val;
 
 	sym_calc_visibility(sym);
 	sym_calc_value(modules_sym);
 	val = symbol_no.curr.tri;
-	str = symbol_empty.curr.val;
 
 	/* If symbol has a default value look it up */
 	prop = sym_get_default_prop(sym);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-26 13:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-25 16:35 [PATCH 1/2] kconfig: remove unneeded symbol_empty variable Masahiro Yamada
2023-11-25 16:35 ` [PATCH 2/2] kconfig: default to zero if int/hex symbol lacks default property Masahiro Yamada
2023-11-25 23:10   ` Yoann Congal
2024-01-23 12:54 ` [PATCH 1/2] kconfig: remove unneeded symbol_empty variable Geert Uytterhoeven
2024-01-23 15:11   ` Yoann Congal
2024-01-24  8:09     ` Masahiro Yamada
2024-01-24  8:56       ` Yoann Congal
2024-01-24 20:12         ` Masahiro Yamada
2024-01-25 14:42           ` Yoann Congal
2024-01-26 13:20             ` Masahiro Yamada
2024-01-25 14:48           ` Geert Uytterhoeven
2024-01-24  9:52       ` Geert Uytterhoeven
2024-01-24 11:43         ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox