[PATCH v1] pinctrl: mpfs-iomux0: fix compile-time constant warning for LLVM prior to 17
Linus Walleij
linus.walleij at linaro.org
Thu Oct 30 01:18:55 PDT 2025
On Wed, Oct 29, 2025 at 4:30 PM Conor Dooley <conor at kernel.org> wrote:
> From: Conor Dooley <conor.dooley at microchip.com>
>
> 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 at kernel.org>
> Link: https://github.com/ClangBuiltLinux/linux/issues/2140
> Fixes: 46397274da22 ("pinctrl: add polarfire soc iomux0 pinmux driver")
> Signed-off-by: Conor Dooley <conor.dooley at microchip.com>
Patch applied!
Yours,
Linus Walleij
More information about the linux-riscv
mailing list