Re: drivers/pinctrl/cirrus/pinctrl-lochnagar.c:200:1: error: implicit declaration of function 'LOCHNAGAR1_' is invalid in C99

From: Arnd Bergmann
Date: Fri Apr 08 2022 - 08:45:52 EST


On Fri, Apr 8, 2022 at 12:02 PM kernel test robot <lkp@xxxxxxxxx> wrote:
> All errors (new ones prefixed by >>):
>
> drivers/pinctrl/cirrus/pinctrl-lochnagar.c:200:1: error: pasting formed 'LOCHNAGAR1_(', an invalid preprocessing token
> LN1_PIN_GPIO(CDC_RESET, "codec-reset", RST, CDC_RESET, 1);
> ^
> drivers/pinctrl/cirrus/pinctrl-lochnagar.c:67:2: note: expanded from macro 'LN1_PIN_GPIO'
> LN_PIN_GPIO(1, ID, NAME, REG, SHIFT, INVERT)
> ^
> drivers/pinctrl/cirrus/pinctrl-lochnagar.c:52:63: note: expanded from macro 'LN_PIN_GPIO'
> .name = NAME, .type = LN_PTYPE_GPIO, .reg = LOCHNAGAR##REV##_##REG, \
> ^
> >> drivers/pinctrl/cirrus/pinctrl-lochnagar.c:200:1: error: implicit declaration of function 'LOCHNAGAR1_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

I have checked this one, and it looks like this is not a regression.
lkp flags it because the error
message changed: with --std=gnu89, the output was

rivers/pinctrl/cirrus/pinctrl-lochnagar.c:200:1: error: implicit
declaration of function 'LOCHNAGAR1_' is invalid in C99
[-Werror,-Wimplicit-function-declaration]

The problem is unrelated to my patch, apparently the global macro named 'RES'
on this platform gets in the way, and removing it fixes the build:

--- a/arch/mips/include/asm/mach-rc32434/rb.h
+++ b/arch/mips/include/asm/mach-rc32434/rb.h
@@ -10,7 +10,6 @@
#define REGBASE 0x18000000
#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
#define UART0BASE 0x58000
-#define RST (1 << 15)
#define DEV0BASE 0x010000
#define DEV0MASK 0x010004
#define DEV0C 0x010008

Arnd