Re: [PATCH] gpio: constify opaque pointer in gpio_device_find() match function

From: Linus Walleij
Date: Fri Feb 09 2024 - 08:25:50 EST


On Thu, Feb 8, 2024 at 9:27 PM Krzysztof Kozlowski
<krzysztof.kozlowski@xxxxxxxxxx> wrote:

> The match function used in gpio_device_find() should not modify the
> contents of passed opaque pointer, because such modification would not
> be necessary for actual matching and it could lead to quite unreadable,
> spaghetti code.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

It's what we call a pure function, good const-correctness fix.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij