[PATCH v2 1/3] kconfig: print the output of expr_alloc_and() instead of printing '&&'
From: Julian Braha
Date: Tue Nov 10 2026 - 12:36:20 EST
Clean up expression printing for 'select' and 'imply' (which ANDs the
select/imply targets), to properly call expr_alloc_and() and print the
output, instead of printing a literal ' && '.
This is necessary to ensure that any '&&' at the end of those lines can
wrap properly.
Signed-off-by: Julian Braha <julianbraha@xxxxxxxxx>
---
scripts/kconfig/menu.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 1a3ad09a92d2..2b2166edeb25 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -761,19 +761,16 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
static void get_symbol_props_str(struct gstr *r, struct symbol *sym,
enum prop_type tok, const char *prefix)
{
- bool hit = false;
+ struct expr *expr = NULL;
struct property *prop;
- for_all_properties(sym, prop, tok) {
- if (!hit) {
- str_append(r, prefix);
- hit = true;
- } else
- str_printf(r, " && ");
- expr_gstr_print(prop->expr, r);
- }
- if (hit)
+ for_all_properties(sym, prop, tok)
+ expr = expr_alloc_and(expr, prop->expr);
+ if (expr) {
+ str_append(r, prefix);
+ expr_gstr_print(expr, r);
str_append(r, "\n");
+ }
}
/*
--
2.56.0