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

- From: Masami Hiramatsu (Google) \<mhiramat@kernel.org\>
- Date: 2026-11-13 02:58:17 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/11/17926263
- Thread: https://ratatoskr.run/linux-trace-kernel/2026/11/17908482/t.md

````text
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]
````
