Re: [PATCH v1] pinctrl: mpfs-iomux0: fix compile-time constant warning for LLVM prior to 17

From: Linus Walleij

Date: Thu Oct 30 2025 - 04:19:07 EST


On Wed, Oct 29, 2025 at 4:30 PM Conor Dooley <conor@xxxxxxxxxx> wrote:

> From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
>
> With LLVM prior to 17.0.0:
>
> drivers/pinctrl/pinctrl-mpfs-iomux0.c:89:2: error: initializer element is not a compile-time constant
> MPFS_IOMUX0_GROUP(spi0),
> ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/pinctrl/pinctrl-mpfs-iomux0.c:79:10: note: expanded from macro 'MPFS_IOMUX0_GROUP'
> .mask = BIT(mpfs_iomux0_##_name##_pins[0]), \
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/vdso/bits.h:7:19: note: expanded from macro 'BIT'
> \#define BIT(nr) (UL(1) << (nr))
> ^~~~~~~~~~~~~~~
>
> This is a constant, but LLVM prior to a change from Nick to match the
> gcc behaviour did not allow this. The macro isn't really all that much
> of an idiot-proofing, just change it to the same sort that's in the
> gpio2 driver, where a second argument provides the mask/setting.
>
> Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> Link: https://github.com/ClangBuiltLinux/linux/issues/2140
> Fixes: 46397274da22 ("pinctrl: add polarfire soc iomux0 pinmux driver")
> Signed-off-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

Patch applied!

Yours,
Linus Walleij