Re: [PATCH] pinctrl: nuvoton: Fix sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 23, 2022 at 12:16:04AM +0100, Linus Walleij wrote:
> Sparse complains:
> drivers/pinctrl/nuvoton/pinctrl-wpcm450.c:626:9:
> sparse: sparse: obsolete array initializer, use C99 syntax
> 
> This is because no equal sign is between the array index
> and the assignments, in the macro.
> 
> Fix it up.
> 
> Cc: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---

Sounds good to me, thanks!

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>


>  drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> index 661aa963e3fc..1402840af11f 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> @@ -613,8 +613,8 @@ static struct wpcm450_func wpcm450_funcs[] = {
>  };
>  
>  #define WPCM450_PINCFG(a, b, c, d, e, f, g) \
> -	[a] { .fn0 = fn_ ## b, .reg0 = WPCM450_GCR_ ## c, .bit0 = d, \
> -	      .fn1 = fn_ ## e, .reg1 = WPCM450_GCR_ ## f, .bit1 = g }
> +	[a] = { .fn0 = fn_ ## b, .reg0 = WPCM450_GCR_ ## c, .bit0 = d, \
> +	        .fn1 = fn_ ## e, .reg1 = WPCM450_GCR_ ## f, .bit1 = g }

You will find the same in the pinctrl-npcm7xx driver:

 #define NPCM7XX_PINCFG(a, b, c, d, e, f, g, h, i, j, k) \
        [a] { .fn0 = fn_ ## b, .reg0 = NPCM7XX_GCR_ ## c, .bit0 = d, /*...*/  }



Jonathan

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux