From: Julian Braha <julianbraha@gmail.com>
To: nathan@kernel.org, nsc@kernel.org
Cc: ojeda@kernel.org, a.hindborg@kernel.org, nico@fluxnic.net,
rdunlap@infradead.org, grahamr@qti.qualcomm.com,
jakub.git@horky.net, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
Julian Braha <julianbraha@gmail.com>
Subject: [PATCH v2 1/3] kconfig: print the output of expr_alloc_and() instead of printing '&&'
Date: Tue, 10 Nov 2026 17:35:24 +0000 [thread overview]
Message-ID: <20261110173526.1548434-2-julianbraha@gmail.com> (raw)
In-Reply-To: <20261110173526.1548434-1-julianbraha@gmail.com>
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@gmail.com>
---
| 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
--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
next prev parent reply other threads:[~2026-11-10 17:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 17:35 [PATCH v2 0/3] kconfig: wrap long expressions in menuconfig Julian Braha
2026-11-10 17:35 ` Julian Braha [this message]
2026-11-10 17:35 ` [PATCH v2 2/3] " Julian Braha
2026-11-10 17:35 ` [PATCH v2 3/3] kconfig: show continuation at the end of wrapped lines Julian Braha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110173526.1548434-2-julianbraha@gmail.com \
--to=julianbraha@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=grahamr@qti.qualcomm.com \
--cc=jakub.git@horky.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nico@fluxnic.net \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®