Skip to contentSkip to conversation

irqchip: gic-v3: Only define gic_peek_irq() when building SMP

PATCH Applied Mark Brown 3 participants 4 messages Jul 27, 2014 – Sep 6, 2014

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 irqchip: gic-v3: Only define gic_peek_irq() when building SMP

From: Mark Brown <[email protected]>

If building with CONFIG_SMP disbled (for example, with allnoconfig) then GCC complains that the static function gic_peek_irq() is defined but not used since the only reference is in the SMP initialisation code. Fix this by moving the function definition inside the ifdef.

---
 drivers/irqchip/irq-gic-v3.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/irqchip/irq-gic-v3.c +13 -13
index 81519bae0453..30130f955151 100644
@@ -200,19 +200,6 @@ static void gic_poke_irq(struct irq_data *d, u32 offset)
 	rwp_wait();
 }
 
-static int gic_peek_irq(struct irq_data *d, u32 offset)
-{
-	u32 mask = 1 << (gic_irq(d) % 32);
-	void __iomem *base;
-
-	if (gic_irq_in_rdist(d))
-		base = gic_data_rdist_sgi_base();
-	else
-		base = gic_data.dist_base;
-
-	return !!(readl_relaxed(base + offset + (gic_irq(d) / 32) * 4) & mask);
-}
-
 static void gic_mask_irq(struct irq_data *d)
 {
 	gic_poke_irq(d, GICD_ICENABLER);
@@ -401,6 +388,19 @@ static void gic_cpu_init(void)
 }
 
 #ifdef CONFIG_SMP
+static int gic_peek_irq(struct irq_data *d, u32 offset)
+{
+	u32 mask = 1 << (gic_irq(d) % 32);
+	void __iomem *base;
+
+	if (gic_irq_in_rdist(d))
+		base = gic_data_rdist_sgi_base();
+	else
+		base = gic_data.dist_base;
+
+	return !!(readl_relaxed(base + offset + (gic_irq(d) / 32) * 4) & mask);
+}
+
 static int gic_secondary_init(struct notifier_block *nfb,
 			      unsigned long action, void *hcpu)
 {
Signature · 1 line
2.0.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Mark Brown

From: Mark Brown <[email protected]>

If building with CONFIG_SMP disbled (for example, with allnoconfig) then GCC complains that the static function gic_peek_irq() is defined but not used since the only reference is in the SMP initialisation code. Fix this by moving the function definition inside the ifdef.

Looks sane to me.

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Applied
#2 lore raw
In reply to Mark Brown

Mark,

Quoted 11 lines · Mark Brown

From: Mark Brown <[email protected]>

If building with CONFIG_SMP disbled (for example, with allnoconfig) then GCC complains that the static function gic_peek_irq() is defined but not used since the only reference is in the SMP initialisation code. Fix this by moving the function definition inside the ifdef.

---
 drivers/irqchip/irq-gic-v3.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Applied to irqchip/urgent with Mark's Ack.

thx,

Jason.

author
#3 lore raw
Quoted 9 lines · Jason Cooper
Quoted 6 lines · Mark Brown

From: Mark Brown <[email protected]>

If building with CONFIG_SMP disbled (for example, with allnoconfig) then GCC complains that the static function gic_peek_irq() is defined but not used since the only reference is in the SMP initialisation code. Fix this by moving the function definition inside the ifdef.

Applied to irqchip/urgent with Mark's Ack.

This also appears to have disappeared from -next and again the warning
is back.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140906/17ba6c0f/attachment.sig>