* [PATCH] arm64: Fix UP build warning in gic-v3
@ 2014-07-28 22:55 Geoff Levand
2014-07-29 11:57 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Geoff Levand @ 2014-07-28 22:55 UTC (permalink / raw)
To: linux-arm-kernel
The static routines gic_write_sgi1r() and gic_peek_irq() are only used for SMP
builds, so move those two routines to within the defined(CONFIG_SMP)
preprocessor conditional.
Fixes build warnings like these when CONFIG_SMP=n:
drivers/irqchip/irq-gic-v3.c: warning: ?gic_write_sgi1r? defined but not used
drivers/irqchip/irq-gic-v3.c: warning: ?gic_peek_irq? defined but not used
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
Hi Marc,
I'm not sure if this has gone upstream yet, but I get these warnings
with Catalin's current arm64/for-next/core branch.
Feel free to just fold this into your gic-v3 patch if you'll be sending out
a new version.
-Geoff
drivers/irqchip/irq-gic-v3.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 57eaa5a..e9ee18a 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -129,11 +129,6 @@ static void gic_write_grpen1(u64 val)
isb();
}
-static void gic_write_sgi1r(u64 val)
-{
- asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val));
-}
-
static void gic_enable_sre(void)
{
u64 val;
@@ -200,19 +195,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 +383,24 @@ static void gic_cpu_init(void)
}
#ifdef CONFIG_SMP
+static void gic_write_sgi1r(u64 val)
+{
+ asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val));
+}
+
+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)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] arm64: Fix UP build warning in gic-v3
2014-07-28 22:55 [PATCH] arm64: Fix UP build warning in gic-v3 Geoff Levand
@ 2014-07-29 11:57 ` Marc Zyngier
2014-07-29 12:03 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2014-07-29 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 28 2014 at 11:55:59 pm BST, Geoff Levand <geoff@infradead.org> wrote:
> The static routines gic_write_sgi1r() and gic_peek_irq() are only used for SMP
> builds, so move those two routines to within the defined(CONFIG_SMP)
> preprocessor conditional.
>
> Fixes build warnings like these when CONFIG_SMP=n:
>
> drivers/irqchip/irq-gic-v3.c: warning: ?gic_write_sgi1r? defined but not used
> drivers/irqchip/irq-gic-v3.c: warning: ?gic_peek_irq? defined but not used
>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> Hi Marc,
>
> I'm not sure if this has gone upstream yet, but I get these warnings
> with Catalin's current arm64/for-next/core branch.
>
> Feel free to just fold this into your gic-v3 patch if you'll be
> sending out a new version.
Hi Geof,
There is a similar patch from Mark Brown on its way (not addressing
gic_write_sgi1r though).
Thanks,
M.
>
> -Geoff
>
> drivers/irqchip/irq-gic-v3.c | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 57eaa5a..e9ee18a 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -129,11 +129,6 @@ static void gic_write_grpen1(u64 val)
> isb();
> }
>
> -static void gic_write_sgi1r(u64 val)
> -{
> - asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val));
> -}
> -
> static void gic_enable_sre(void)
> {
> u64 val;
> @@ -200,19 +195,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 +383,24 @@ static void gic_cpu_init(void)
> }
>
> #ifdef CONFIG_SMP
> +static void gic_write_sgi1r(u64 val)
> +{
> + asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val));
> +}
> +
> +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)
> {
--
Jazz is not dead. It just smells funny.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] arm64: Fix UP build warning in gic-v3
2014-07-29 11:57 ` Marc Zyngier
@ 2014-07-29 12:03 ` Mark Brown
2014-07-29 12:39 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2014-07-29 12:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 29, 2014 at 12:57:16PM +0100, Marc Zyngier wrote:
> There is a similar patch from Mark Brown on its way (not addressing
> gic_write_sgi1r though).
Right, I was thinking that was better fixed by making all those
access functions static inline instead, I didn't get round to looking at
that properly yet though so didn't send a patch. Moving the one
accessor function felt like it was the wrong way to go but that's just
taste.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140729/47b161a0/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] arm64: Fix UP build warning in gic-v3
2014-07-29 12:03 ` Mark Brown
@ 2014-07-29 12:39 ` Marc Zyngier
0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2014-07-29 12:39 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 29 2014 at 1:03:17 pm BST, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Jul 29, 2014 at 12:57:16PM +0100, Marc Zyngier wrote:
>
>> There is a similar patch from Mark Brown on its way (not addressing
>> gic_write_sgi1r though).
>
> Right, I was thinking that was better fixed by making all those
> access functions static inline instead, I didn't get round to looking at
> that properly yet though so didn't send a patch. Moving the one
> accessor function felt like it was the wrong way to go but that's just
> taste.
I don't mind either way. As long as no annoying warning is produced, I'm
cool with it.
M.
--
Jazz is not dead. It just smells funny.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-29 12:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-28 22:55 [PATCH] arm64: Fix UP build warning in gic-v3 Geoff Levand
2014-07-29 11:57 ` Marc Zyngier
2014-07-29 12:03 ` Mark Brown
2014-07-29 12:39 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).