Thread (37 messages) 37 messages, 5 authors, 2021-03-09

Re: [PATCH v2 09/12] gpio: sim: new testing module

From: Bartosz Golaszewski <hidden>
Date: 2021-03-08 14:24:26
Also in: linux-doc, lkml

On Fri, Mar 5, 2021 at 11:15 AM Andy Shevchenko
[off-list ref] wrote:
On Thu, Mar 04, 2021 at 09:15:29PM +0100, Bartosz Golaszewski wrote:
quoted
On Thu, Mar 4, 2021 at 2:15 PM Andy Shevchenko
[off-list ref] wrote:
quoted
On Thu, Mar 04, 2021 at 11:24:49AM +0100, Bartosz Golaszewski wrote:
quoted
From: Bartosz Golaszewski <redacted>
quoted
quoted
quoted
+
+     /*
+      * 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?

If you're not objecting strongly, then I would prefer my version.
...
quoted
quoted
quoted
+     ida_free(&gpio_sim_ida, id);
Isn't it atomic per se? I mean that IDA won't give the same ID until you free
it. I.o.w. why is it under the mutex?
You're right but if we rapidly create and destroy chips we'll be left
with holes in the numbering (because new devices would be created
before the IDA numbers are freed, so the driver would take a larger
number that's currently free). It doesn't hurt but it would look worse
IMO. Do you have a strong opinion on this?
It's not strong per se, but I would rather follow the 2nd rule of locking:
don't protect something which doesn't need it.
OK, makes sense.
--
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help