public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* gpios search behaviour for gpio from _DSD
@ 2015-09-24  7:25 Olliver Schinagl
  2015-09-24  8:43 ` Mika Westerberg
  0 siblings, 1 reply; 4+ messages in thread
From: Olliver Schinagl @ 2015-09-24  7:25 UTC (permalink / raw)
  To: Mika Westerberg, Linus Walleij, Grant Likely, Rafael J. Wysocki,
	Alexandre Courbot
  Cc: linux-gpio, linux-kernel

Hey list, Mika,

With commit 0d9a693cc86 the following snippet of code was added:

+       /* Try first from _DSD */
+       for (i = 0; i < ARRAY_SIZE(suffixes); i++) {
+               if (con_id && strcmp(con_id, "gpios")) {
+                       snprintf(propname, sizeof(propname), "%s-%s",
+                                con_id, suffixes[i]);

and I was wondering why the gpios suffix is singled out. Are we not 
allowed to check for all the strings in the suffixes array? Is gpios 
special or is gpio simply not allowed. If that strcmp check would be 
removed, would bad things happen?

Also, just to educate myself, isn't relying on left to right parsing 
complier specifc? E.g. if con_id is null, we end up passing NULL to 
strcmp and atleast for libc can cause segfaults iirc.

Thanks,
Olliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-28  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24  7:25 gpios search behaviour for gpio from _DSD Olliver Schinagl
2015-09-24  8:43 ` Mika Westerberg
2015-09-26 19:30   ` Olliver Schinagl
2015-09-28  7:30     ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox