public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning
@ 2021-03-23 13:08 Arnd Bergmann
  2021-04-01 10:23 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2021-03-23 13:08 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: soc, Arnd Bergmann, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The default initializer at the start of the array causes a warning
when building with W=1:

In file included from arch/arm/mach-pxa/mainstone.c:47:
arch/arm/mach-pxa/mainstone.h:124:33: error: initialized field overwritten [-Werror=override-init]
  124 | #define MAINSTONE_IRQ(x)        (MAINSTONE_NR_IRQS + (x))
      |                                 ^
arch/arm/mach-pxa/mainstone.h:133:33: note: in expansion of macro 'MAINSTONE_IRQ'
  133 | #define MAINSTONE_S0_CD_IRQ     MAINSTONE_IRQ(9)
      |                                 ^~~~~~~~~~~~~
arch/arm/mach-pxa/mainstone.c:506:15: note: in expansion of macro 'MAINSTONE_S0_CD_IRQ'
  506 |         [5] = MAINSTONE_S0_CD_IRQ,
      |               ^~~~~~~~~~~~~~~~~~~

Rework the initializer to list each element explicitly and only once.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/mainstone.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 6f4b64727df1..599736c93163 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -502,16 +502,20 @@ static inline void mainstone_init_keypad(void) {}
 #endif
 
 static int mst_pcmcia0_irqs[11] = {
-	[0 ... 10] = -1,
+	[0 ... 4] = -1,
 	[5] = MAINSTONE_S0_CD_IRQ,
+	[6 ... 7] = -1,
 	[8] = MAINSTONE_S0_STSCHG_IRQ,
+	[9] = -1,
 	[10] = MAINSTONE_S0_IRQ,
 };
 
 static int mst_pcmcia1_irqs[11] = {
-	[0 ... 10] = -1,
+	[0 ... 4] = -1,
 	[5] = MAINSTONE_S1_CD_IRQ,
+	[6 ... 7] = -1,
 	[8] = MAINSTONE_S1_STSCHG_IRQ,
+	[9] = -1,
 	[10] = MAINSTONE_S1_IRQ,
 };
 
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning
  2021-03-23 13:08 [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning Arnd Bergmann
@ 2021-04-01 10:23 ` Arnd Bergmann
  2021-04-10  8:15   ` Robert Jarzmik
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2021-04-01 10:23 UTC (permalink / raw)
  To: Daniel Mack, Robert Jarzmik, Arnd Bergmann, Haojian Zhuang
  Cc: Arnd Bergmann, linux-kernel, linux-arm-kernel, soc

From: Arnd Bergmann <arnd@arndb.de>

On Tue, 23 Mar 2021 14:08:27 +0100, Arnd Bergmann wrote:
> The default initializer at the start of the array causes a warning
> when building with W=1:
> 
> In file included from arch/arm/mach-pxa/mainstone.c:47:
> arch/arm/mach-pxa/mainstone.h:124:33: error: initialized field overwritten [-Werror=override-init]
>   124 | #define MAINSTONE_IRQ(x)        (MAINSTONE_NR_IRQS + (x))
>       |                                 ^
> arch/arm/mach-pxa/mainstone.h:133:33: note: in expansion of macro 'MAINSTONE_IRQ'
>   133 | #define MAINSTONE_S0_CD_IRQ     MAINSTONE_IRQ(9)
>       |                                 ^~~~~~~~~~~~~
> arch/arm/mach-pxa/mainstone.c:506:15: note: in expansion of macro 'MAINSTONE_S0_CD_IRQ'
>   506 |         [5] = MAINSTONE_S0_CD_IRQ,
>       |               ^~~~~~~~~~~~~~~~~~~
> 
> [...]

Applied to arm/fixes.

[1/1] ARM: pxa: mainstone: avoid -Woverride-init warning
      commit: b08f9cc97c8e1be0f06fc6e5d467ed389a4161ff

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning
  2021-04-01 10:23 ` Arnd Bergmann
@ 2021-04-10  8:15   ` Robert Jarzmik
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2021-04-10  8:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Mack, Haojian Zhuang, Arnd Bergmann, linux-kernel,
	linux-arm-kernel, soc

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> On Tue, 23 Mar 2021 14:08:27 +0100, Arnd Bergmann wrote:
>> The default initializer at the start of the array causes a warning
>> when building with W=1:
>> 
>> In file included from arch/arm/mach-pxa/mainstone.c:47:
>> arch/arm/mach-pxa/mainstone.h:124:33: error: initialized field overwritten [-Werror=override-init]
>>   124 | #define MAINSTONE_IRQ(x)        (MAINSTONE_NR_IRQS + (x))
>>       |                                 ^
>> arch/arm/mach-pxa/mainstone.h:133:33: note: in expansion of macro 'MAINSTONE_IRQ'
>>   133 | #define MAINSTONE_S0_CD_IRQ     MAINSTONE_IRQ(9)
>>       |                                 ^~~~~~~~~~~~~
>> arch/arm/mach-pxa/mainstone.c:506:15: note: in expansion of macro 'MAINSTONE_S0_CD_IRQ'
>>   506 |         [5] = MAINSTONE_S0_CD_IRQ,
>>       |               ^~~~~~~~~~~~~~~~~~~
>> 
>> [...]
>
> Applied to arm/fixes.
Too late, but ...
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

-- 
Robert

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-10  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-23 13:08 [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning Arnd Bergmann
2021-04-01 10:23 ` Arnd Bergmann
2021-04-10  8:15   ` Robert Jarzmik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox