Re: [PATCH v2 1/3] tools/bootconfig: Close only opened braces in compact output

From
Eduardo Mucelli <hidden>
Date
2026-11-13 08:49:17
Also in
lkml
Reply to
Masami Hiramatsu (Google), 2026-11-13
Hi Masami,

Thanks for the review.

Using the existing helper as you pointed out it is indeed better.
Given you have already picked it up. Would you prefer a small follow-up cleanup?

Thanks,

On Fri, Nov 13, 2026 at 3:58 AM Masami Hiramatsu (Google)
[off-list ref] wrote:
On Tue, 10 Nov 2026 20:08:45 +0100, Eduardo Mucelli Rezende Oliveira [off-list ref] wrote:
quoted
[...]
Extend the mixed-value/subkey sample to cover the lost sibling.

Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <redacted>
This basically looks good to me.

Just have a comment below.
quoted
---
Changes in v2:
- Determine whether braces were opened from the key children instead of
[...]
quoted
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -68,6 +68,23 @@ static int xbc_show_value(struct xbc_node *node, bool semicolon)
+/* Match the conditions under which the compact formatter opens braces. */
+static bool xbc_node_needs_braces(struct xbc_node *node)
+{
+     struct xbc_node *child = xbc_node_get_child(node);
Nit: You can use `xbc_node_get_subkey(node)` here instead of manually
fetching the first child and skipping the value node:
        struct xbc_node *child = xbc_node_get_subkey(node);
Thanks,
quoted
+
+     if (child && xbc_node_is_value(child))
+             child = xbc_node_get_next(child);
--
Masami Hiramatsu (Google) [off-list ref]


-- 
Eduardo Mucelli R. Oliveira -- http://eduar.do
Thread (17 messages) 17 messages, 3 authors, last reply 12h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help