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

From: Andy Shevchenko
Date: Mon May 21 2018 - 16:55:57 EST


On Mon, May 21, 2018 at 2:57 PM, Yisheng Xie <xieyisheng1@xxxxxxxxxx> 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@xxxxxxxxxxxx>
> Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
> Cc: Eric Anholt <eric@xxxxxxxxxx>
> Cc: Stefan Wahren <stefan.wahren@xxxxxxxx>
> Cc: linux-clk@xxxxxxxxxxxxxxx
> Cc: linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Signed-off-by: Yisheng Xie <xieyisheng1@xxxxxxxxxx>

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