* [PATCH] irqchip/sirfsoc: fix sparse warnings on __iomem
@ 2016-06-07 12:18 Ben Dooks
2016-06-13 0:52 ` Jason Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2016-06-07 12:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ben Dooks, Thomas Gleixner, Jason Cooper, Marc Zyngier,
Barry Song, linux-kernel, linux-arm-kernel
Fix warnings from sparse about casting to __iomem from non anotated
variable:
drivers/irqchip/irq-sirfsoc.c:56:47: warning: incorrect type in initializer (different address spaces)
drivers/irqchip/irq-sirfsoc.c:56:47: expected void [noderef] <asn:2>*base
drivers/irqchip/irq-sirfsoc.c:56:47: got void *host_data
drivers/irqchip/irq-sirfsoc.c:97:47: warning: incorrect type in initializer (different address spaces)
drivers/irqchip/irq-sirfsoc.c:97:47: expected void [noderef] <asn:2>*base
drivers/irqchip/irq-sirfsoc.c:97:47: got void *host_data
drivers/irqchip/irq-sirfsoc.c:109:47: warning: incorrect type in initializer (different address spaces)
drivers/irqchip/irq-sirfsoc.c:109:47: expected void [noderef] <asn:2>*base
drivers/irqchip/irq-sirfsoc.c:109:47: got void *host_data
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---
drivers/irqchip/irq-sirfsoc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-sirfsoc.c b/drivers/irqchip/irq-sirfsoc.c
index 10cb21b..e133684 100644
--- a/drivers/irqchip/irq-sirfsoc.c
+++ b/drivers/irqchip/irq-sirfsoc.c
@@ -29,6 +29,11 @@
static struct irq_domain *sirfsoc_irqdomain;
+static void __iomem *sirfsoc_irq_get_regbase(void)
+{
+ return (void __iomem __force *)sirfsoc_irqdomain->host_data;
+}
+
static __init void sirfsoc_alloc_gc(void __iomem *base)
{
unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
@@ -53,7 +58,7 @@ static __init void sirfsoc_alloc_gc(void __iomem *base)
static void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
{
- void __iomem *base = sirfsoc_irqdomain->host_data;
+ void __iomem *base = sirfsoc_irq_get_regbase();
u32 irqstat;
irqstat = readl_relaxed(base + SIRFSOC_INIT_IRQ_ID);
@@ -94,7 +99,7 @@ static struct sirfsoc_irq_status sirfsoc_irq_st;
static int sirfsoc_irq_suspend(void)
{
- void __iomem *base = sirfsoc_irqdomain->host_data;
+ void __iomem *base = sirfsoc_irq_get_regbase();
sirfsoc_irq_st.mask0 = readl_relaxed(base + SIRFSOC_INT_RISC_MASK0);
sirfsoc_irq_st.mask1 = readl_relaxed(base + SIRFSOC_INT_RISC_MASK1);
@@ -106,7 +111,7 @@ static int sirfsoc_irq_suspend(void)
static void sirfsoc_irq_resume(void)
{
- void __iomem *base = sirfsoc_irqdomain->host_data;
+ void __iomem *base = sirfsoc_irq_get_regbase();
writel_relaxed(sirfsoc_irq_st.mask0, base + SIRFSOC_INT_RISC_MASK0);
writel_relaxed(sirfsoc_irq_st.mask1, base + SIRFSOC_INT_RISC_MASK1);
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] irqchip/sirfsoc: fix sparse warnings on __iomem
2016-06-07 12:18 [PATCH] irqchip/sirfsoc: fix sparse warnings on __iomem Ben Dooks
@ 2016-06-13 0:52 ` Jason Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Jason Cooper @ 2016-06-13 0:52 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Thomas Gleixner, Marc Zyngier, Barry Song,
linux-kernel, linux-arm-kernel
Hi Ben,
On Tue, Jun 07, 2016 at 01:18:30PM +0100, Ben Dooks wrote:
> Fix warnings from sparse about casting to __iomem from non anotated
> variable:
>
> drivers/irqchip/irq-sirfsoc.c:56:47: warning: incorrect type in initializer (different address spaces)
> drivers/irqchip/irq-sirfsoc.c:56:47: expected void [noderef] <asn:2>*base
> drivers/irqchip/irq-sirfsoc.c:56:47: got void *host_data
> drivers/irqchip/irq-sirfsoc.c:97:47: warning: incorrect type in initializer (different address spaces)
> drivers/irqchip/irq-sirfsoc.c:97:47: expected void [noderef] <asn:2>*base
> drivers/irqchip/irq-sirfsoc.c:97:47: got void *host_data
> drivers/irqchip/irq-sirfsoc.c:109:47: warning: incorrect type in initializer (different address spaces)
> drivers/irqchip/irq-sirfsoc.c:109:47: expected void [noderef] <asn:2>*base
> drivers/irqchip/irq-sirfsoc.c:109:47: got void *host_data
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Barry Song <baohua@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> drivers/irqchip/irq-sirfsoc.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
Applied to irqchip/misc
thx,
Jason.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-13 1:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 12:18 [PATCH] irqchip/sirfsoc: fix sparse warnings on __iomem Ben Dooks
2016-06-13 0:52 ` Jason Cooper
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).