Thread (4 messages) 4 messages, 3 authors, 2018-05-22

[PATCH 12/33] clk: bcm2835: use match_string() helper

From: Andy Shevchenko <hidden>
Date: 2018-05-21 21:50:34
Also in: linux-clk, lkml

On Mon, May 21, 2018 at 2:57 PM, Yisheng Xie [off-list ref] wrote:
match_string() returns the index of an array for a matching string,
which can be used intead of open coded variant.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Eric Anholt <redacted>
Cc: Stefan Wahren <redacted>
Cc: linux-clk at vger.kernel.org
Cc: linux-rpi-kernel at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Yisheng Xie <redacted>
-       size_t i, j;
-       int ret;
+       int i, ret;
I do not see any need to change type for i.
+               ret = match_string(cprman_parent_names,
+                                  ARRAY_SIZE(cprman_parent_names),
+                                  parents[i]);
+               if (ret >= 0)
+                       parents[i] = cprman->real_parent_names[ret];

-- 
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