Skip to contentSkip to conversation

ARM: mvebu: fix compilation warning on Armada 370 (i.e. non-SMP)

PATCH New Arnaud Ebalard 2 participants 3 messages Jan 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mvebu: fix compilation warning on Armada 370 (i.e. non-SMP)

The following appears during compilation for an Armada 370 target because 'irq_controller_lock' is used only when CONFIG_SMP is enabled:

drivers/irqchip/irq-armada-370-xp.c:62:8: warning: 'irq_controller_lock' defined but not used [-Wunused-variable]

Fix that warning by protecting declaration via an #ifdef.

---
 drivers/irqchip/irq-armada-370-xp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/irqchip/irq-armada-370-xp.c +2 -0
index 433cc8568dec..499c5070f841 100644
@@ -59,7 +59,9 @@
 #define PCI_MSI_DOORBELL_END                    (32)
 #define PCI_MSI_DOORBELL_MASK                   0xFFFF0000
 
+#ifdef CONFIG_SMP
 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+#endif
 
 static void __iomem *per_cpu_int_base;
 static void __iomem *main_int_base;
Signature · 1 line
1.8.5.2
#1 lore raw

PATCH 1/1 ARM: mvebu: fix compilation warning on Armada 370 (i.e. non-SMP)

drivers/irqchip/irq-armada-370-xp.c line 66

Quoted 13 lines · On Monday 20 January 2014 21:14:13 Arnaud Ebalard wrote:
drivers/irqchip/irq-armada-370-xp.c +2 -0
index 433cc8568dec..499c5070f841 100644
@@ -59,7 +59,9 @@
 #define PCI_MSI_DOORBELL_END                    (32)
 #define PCI_MSI_DOORBELL_MASK                   0xFFFF0000
 
+#ifdef CONFIG_SMP
 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+#endif
 
 static void __iomem *per_cpu_

How about moving it inside of the existing #ifdef?

That also brings it closer to the one place it's used.

Arnd

#2 lore raw

PATCH 1/1 ARM: mvebu: fix compilation warning on Armada 370 (i.e. non-SMP)

Hi Arnd,

Quoted 13 lines · Arnd Bergmann
Quoted 12 lines · On Monday 20 January 2014 21:14:13 Arnaud Ebalard wrote:
drivers/irqchip/irq-armada-370-xp.c +2 -0
index 433cc8568dec..499c5070f841 100644
@@ -59,7 +59,9 @@
 #define PCI_MSI_DOORBELL_END                    (32)
 #define PCI_MSI_DOORBELL_MASK                   0xFFFF0000
 
+#ifdef CONFIG_SMP
 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+#endif
 
Quoted 5 lines

drivers/irqchip/irq-armada-370-xp.c line 66

Quoted 1 line
drivers/irqchip/irq-armada-370-xp.c +0 -0
 static void __iomem *per_cpu_

How about moving it inside of the existing #ifdef?

That also brings it closer to the one place it's used.

I also hesitated but decided to let the declaration of this global at the beginning of the file. I will send a v2 with the declaration moved inside the existing #ifdef.

Cheers,

a+