# 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 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/11/17927436
- Thread: https://ratatoskr.run/linux-trace-kernel/2026/11/17908482/t.md

````text
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)
[ref] wrote:
>
> On Tue, 10 Nov 2026 20:08:45 +0100, Eduardo Mucelli Rezende Oliveira [ref] wrote:
> > [...]
> > 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.
>
> > ---
> > Changes in v2:
> > - Determine whether braces were opened from the key children instead of
> > [...]
>
> > 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,
>
> > +
> > +     if (child && xbc_node_is_value(child))
> > +             child = xbc_node_get_next(child);
>
> --
> Masami Hiramatsu (Google) [ref]



-- 
Eduardo Mucelli R. Oliveira -- http://eduar.do
````
