]> git.ipfire.org Git - thirdparty/linux.git/commit
pinctrl: mpfs-iomux0: fix compile-time constant warning for LLVM prior to 17
authorConor Dooley <conor.dooley@microchip.com>
Wed, 29 Oct 2025 15:29:35 +0000 (15:29 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 30 Oct 2025 08:18:13 +0000 (09:18 +0100)
commit99224c151c19b74e1930d236dd348b6b22a607a5
tree022efcab67e2d425b4130a2585119d80198710c6
parent002679f79ed605e543fbace465557317cd307c9a
pinctrl: mpfs-iomux0: fix compile-time constant warning for LLVM prior to 17

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@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@microchip.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-mpfs-iomux0.c