2013-10-29 14:45:29

by Vincent Donnefort

[permalink] [raw]
Subject: [PATCH] irqchip: aramda370-xp: fix compilation warning

From: Vincent Donnefort <[email protected]>

Fix the following compilation warning:
drivers/irqchip/irq-armada-370-xp.c:55:23: warning: 'irq_controller_lock' defined but not used [-Wunused-variable]

Signed-off-by: Vincent Donnefort <[email protected]>

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index bb328a3..75c3141 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -52,7 +52,9 @@
#define IPI_DOORBELL_END (8)
#define IPI_DOORBELL_MASK 0xFF

+#ifdef CONFIG_SMP
static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+#endif

static void __iomem *per_cpu_int_base;
static void __iomem *main_int_base;
--
1.8.3.2


2013-10-29 15:04:42

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] irqchip: aramda370-xp: fix compilation warning

Vincent,

On Tue, 29 Oct 2013, Vincent Donnefort wrote:

Subject line : irqchip: aramda370-xp: fix compilation warning

We are not fixing compilation warnings. We modify the code so the
compiler does not longer issue a warning.

> From: Vincent Donnefort <[email protected]>
>
> Fix the following compilation warning:
> drivers/irqchip/irq-armada-370-xp.c:55:23: warning: 'irq_controller_lock' defined but not used [-Wunused-variable]
>
> Signed-off-by: Vincent Donnefort <[email protected]>
>
> diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
> index bb328a3..75c3141 100644
> --- a/drivers/irqchip/irq-armada-370-xp.c
> +++ b/drivers/irqchip/irq-armada-370-xp.c
> @@ -52,7 +52,9 @@
> #define IPI_DOORBELL_END (8)
> #define IPI_DOORBELL_MASK 0xFF
>
> +#ifdef CONFIG_SMP
> static DEFINE_RAW_SPINLOCK(irq_controller_lock);
> +#endif

Instead of adding a new ifdeffery you should just move it into the
existing #ifdef CONFIG_SMP section, which also contains the only usage
site of irq_controller_lock

Thanks,

tglx

2013-10-29 15:47:01

by Vincent Donnefort

[permalink] [raw]
Subject: [PATCH V2] irqchip: aramda370-xp: move spinlock declaration into CONFIG_SMP section

From: Vincent Donnefort <[email protected]>

Fix the following compilation warning:
drivers/irqchip/irq-armada-370-xp.c:55:23: warning: 'irq_controller_lock' defined but not used [-Wunused-variable]

Signed-off-by: Vincent Donnefort <[email protected]>

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index bb328a3..63aa29b 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -52,8 +52,6 @@
#define IPI_DOORBELL_END (8)
#define IPI_DOORBELL_MASK 0xFF

-static DEFINE_RAW_SPINLOCK(irq_controller_lock);
-
static void __iomem *per_cpu_int_base;
static void __iomem *main_int_base;
static struct irq_domain *armada_370_xp_mpic_domain;
@@ -88,6 +86,8 @@ static void armada_370_xp_irq_unmask(struct irq_data *d)
}

#ifdef CONFIG_SMP
+static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+
static int armada_xp_set_affinity(struct irq_data *d,
const struct cpumask *mask_val, bool force)
{
--
1.8.3.2