Re: [PATCH v1 2/2] gpiolib: Check array_info for NULL only once in gpiod_get_array()

From: Linus Walleij
Date: Thu Mar 23 2023 - 04:19:03 EST


On Tue, Mar 21, 2023 at 2:53 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> gpiod_get_array() has a long if-else-if branching where each of them
> tests for the same variable to be not NULL. Instead, check for NULL
> before even going to that flow.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

It's way more readable like this.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij