[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMpxmJVTUfveuaY9yhP5PLXoOdrkYQ2WbE5-P+4XRi3=VdQKjg@mail.gmail.com>
Date: Mon, 8 Mar 2021 16:13:33 +0100
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Joel Becker <jlbec@...lplan.org>,
Christoph Hellwig <hch@....de>, Shuah Khan <shuah@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Kent Gibson <warthog618@...il.com>,
Jonathan Corbet <corbet@....net>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-doc <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v2 09/12] gpio: sim: new testing module
On Mon, Mar 8, 2021 at 4:05 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Mon, Mar 08, 2021 at 03:23:31PM +0100, Bartosz Golaszewski wrote:
> > On Fri, Mar 5, 2021 at 11:15 AM Andy Shevchenko
> > <andriy.shevchenko@...ux.intel.com> wrote:
> > > On Thu, Mar 04, 2021 at 09:15:29PM +0100, Bartosz Golaszewski wrote:
> > > > On Thu, Mar 4, 2021 at 2:15 PM Andy Shevchenko
> > > > <andriy.shevchenko@...ux.intel.com> wrote:
> > > > > On Thu, Mar 04, 2021 at 11:24:49AM +0100, Bartosz Golaszewski wrote:
> > > > > > From: Bartosz Golaszewski <bgolaszewski@...libre.com>
>
> > > > > > +
> > > > > > + /*
> > > > > > + * FIXME If anyone knows a better way to parse that - please let me
> > > > > > + * know.
> > > > > > + */
> > > > >
> > > > > If comma can be replaced with ' ' (space) then why not to use next_arg() from
> > > > > cmdline.c? I.o.w. do you have strong opinion why should we use comma here?
> > > > >
> > > >
> > > > My opinion is not very strong but I wanted to make the list of names
> > > > resemble what we pass to the gpio-line-names property in device tree.
> > > > Doesn't next_arg() react differently to string of the form: "foo=bar"?
> > >
> > > It's ambiguous here.
> > >
> > > So, the strings '"foo=bar"' and 'foo=bar' (w/o single quotes!) are indeed
> > > parsed differently, i.e.
> > > '"foo=bar"' -> 'foo=bar',
> > > while
> > > "foo=bar" -> 'foo' + 'bar'.
> > >
> >
> > IMO '"foo", "bar", "", "foobar"' looks better than '"foo" "bar" ""
> > "foobar"' and I'm also not sure next_arg will understand an empty
> > quote?
>
> I guess it understands it. But I agree that comma-separated it would look
> better.
>
> > If you're not objecting strongly, then I would prefer my version.
>
> I have strong opinion not to open code "yet another parser".
>
> So, grepping on 'strsep(.*, ",")' shows a lot of code that wants something like
> this. Interesting are the net/9p cases. This in particular pointed out to
> lib/parser.c which in turn shows promising match_strlcpy() / match_strdup(). I
> haven't looked deeply though.
>
> That said, I agree that next_arg() is not the best here.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Shall we revisit this once it's upstream with a generalization for
separating comma separated strings?
Bart
Powered by blists - more mailing lists