From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Julius Werner <jwerner@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
linux-trace-kernel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bootconfig: Fix to terminate value search if it hits a newline
Date: Sat, 31 Jan 2026 11:19:51 +0900 [thread overview]
Message-ID: <20260131111951.99058146c69f2a729f7be643@kernel.org> (raw)
In-Reply-To: <CAODwPW90ALuMy6kFPqQSj_vN7krRz6cpksAUm2WHJNYwRNxHnA@mail.gmail.com>
On Fri, 30 Jan 2026 15:26:46 -0800
Julius Werner <jwerner@google.com> wrote:
> > > Note that if the line has a comment, it still keep searching the
> > > value to the next line::
> > >
> > > foo = # comment
> > > value
>
> This seems inconsistent to me tbh. I think someone could reasonably
> write a bootconfig like this:
>
> foo = # We leave foo empty here because <reason>
> bar = value
>
> and expect it to work. There's nothing in the documentation that
> suggests empty values would behave differently if there is a comment
> behind them.
But we already accept that example in the tree.
tools/bootconfig/samples/good-array-space-comment.bconf
So it is hard to change this syntax. But without comment, the
document defines the value is terminated with a newline. Thus
it needs to be fixed.
>
> Also, I believe your patch might inadvertently break this case (which
> I think(?) is supposed to work):
>
> foo = first array value,
> second array value,
> third array value
Oops, good catch! I should add this as a good sample.
>
> Because __xbc_parse_value() returns from the first value with `&next`
> pointing at the newline behind the comma, and that is passed to the
> next iteration of __xbc_parse_value() which will now no longer skip
> it. I think an already started array may need to be treated as a
> special case here and you may want to add another
> skip_spaces()/skip_comment() to the loop in xbc_parse_array().
OK, let me fix it.
Thanks,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-01-31 2:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 4:41 [PATCH] bootconfig: Fix to terminate value search if it hits a newline Masami Hiramatsu (Google)
2026-01-30 14:53 ` Steven Rostedt
2026-01-30 23:26 ` Julius Werner
2026-01-31 2:19 ` Masami Hiramatsu [this message]
2026-02-02 23:05 ` Julius Werner
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=20260131111951.99058146c69f2a729f7be643@kernel.org \
--to=mhiramat@kernel.org \
--cc=jwerner@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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