Re: [PATCH] pinctrl: rp1: Use ARRAY_SIZE() to compute group sizes
From: Linus Walleij
Date: Tue Dec 01 2026 - 09:44:50 EST
On Wed, Nov 25, 2026 at 3:18 PM Andrea della Porta
<andrea.porta@xxxxxxxx> wrote:
> drivers/pinctrl/pinctrl-rp1.c:343:39-40: WARNING: Use ARRAY_SIZE
> drivers/pinctrl/pinctrl-rp1.c:444:33-34: WARNING: Use ARRAY_SIZE
>
> PIN_ARRAY_SIZE() and GRP_ARRAY_SIZE() open-code the element count of a
> compound literal as sizeof(array) / sizeof(element), duplicating the
> element type from the corresponding PIN_ARRAY() and GRP_ARRAY() macros.
>
> Use ARRAY_SIZE() on the PIN_ARRAY()/GRP_ARRAY() compound literals
> instead, so the element type is no longer repeated and the array check
> in ARRAY_SIZE() applies. Wrap the compound literals in parentheses so
> they can be safely passed as macro arguments, and include
> <linux/array_size.h> explicitly.
>
> No functional change is expected.
>
> Fixes: e3ce7b897388 ("pinctrl: rp1: Implement RaspberryPi RP1 pinmux/pinconf support")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/20261117140555.KfUW4BDK-lkp@xxxxxxxxx/
> Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
Patch applied as nonurgent fix.
Yours,
Linus Walleij