diff mbox series

[1/2] sparc32: Move ioremap/iounmap declaration before asm-generic/io.h include

Message ID 20200915093203.16934-2-lorenzo.pieralisi@arm.com (mailing list archive)
State New, archived
Headers show
Series Fix pci_iounmap() on !CONFIG_GENERIC_IOMAP | expand

Commit Message

Lorenzo Pieralisi Sept. 15, 2020, 9:32 a.m. UTC
Move the ioremap/iounmap declaration before asm-generic/io.h is
included so that it is visible within it.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
 arch/sparc/include/asm/io_32.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Christoph Hellwig Sept. 15, 2020, 2:14 p.m. UTC | #1
> diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
> index 9a52d9506f80..042201c79ad1 100644
> --- a/arch/sparc/include/asm/io_32.h
> +++ b/arch/sparc/include/asm/io_32.h
> @@ -11,6 +11,16 @@
>  #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz)
>  #define memcpy_toio(d,s,sz)   _memcpy_toio(d,s,sz)
>  
> +#ifdef __KERNEL__
> +
> +/*
> + * Bus number may be embedded in the higher bits of the physical address.
> + * This is why we have no bus number argument to ioremap().
> + */
> +void __iomem *ioremap(phys_addr_t offset, size_t size);
> +void iounmap(volatile void __iomem *addr);
> +#endif

No need for an __KERNEL__ in non-uapi headers.
Lorenzo Pieralisi Sept. 15, 2020, 2:54 p.m. UTC | #2
On Tue, Sep 15, 2020 at 03:14:52PM +0100, Christoph Hellwig wrote:
> > diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
> > index 9a52d9506f80..042201c79ad1 100644
> > --- a/arch/sparc/include/asm/io_32.h
> > +++ b/arch/sparc/include/asm/io_32.h
> > @@ -11,6 +11,16 @@
> >  #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz)
> >  #define memcpy_toio(d,s,sz)   _memcpy_toio(d,s,sz)
> >  
> > +#ifdef __KERNEL__
> > +
> > +/*
> > + * Bus number may be embedded in the higher bits of the physical address.
> > + * This is why we have no bus number argument to ioremap().
> > + */
> > +void __iomem *ioremap(phys_addr_t offset, size_t size);
> > +void iounmap(volatile void __iomem *addr);
> > +#endif
> 
> No need for an __KERNEL__ in non-uapi headers.

Sure, just kept the same preproc guard as current code, will add a patch
to remove the guard first before this one then.

Thanks,
Lorenzo
David Miller Sept. 15, 2020, 8:11 p.m. UTC | #3
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date: Tue, 15 Sep 2020 10:32:02 +0100

> Move the ioremap/iounmap declaration before asm-generic/io.h is
> included so that it is visible within it.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Acked-by: David S. Miller <davem@davemloft.net>
Lorenzo Pieralisi Oct. 2, 2020, 2:50 p.m. UTC | #4
On Tue, Sep 15, 2020 at 01:11:21PM -0700, David Miller wrote:
> From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Date: Tue, 15 Sep 2020 10:32:02 +0100
> 
> > Move the ioremap/iounmap declaration before asm-generic/io.h is
> > included so that it is visible within it.
> > 
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> 
> Acked-by: David S. Miller <davem@davemloft.net>

Hi David,

can I apply your Acked-by to v2 (where I had to split this patch in 2):

https://lore.kernel.org/lkml/cover.1600254147.git.lorenzo.pieralisi@arm.com
I am about to merge it - please let me know.

Thanks,
Lorenzo
David Miller Oct. 2, 2020, 10:44 p.m. UTC | #5
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date: Fri, 2 Oct 2020 15:50:29 +0100

> On Tue, Sep 15, 2020 at 01:11:21PM -0700, David Miller wrote:
>> From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>> Date: Tue, 15 Sep 2020 10:32:02 +0100
>> 
>> > Move the ioremap/iounmap declaration before asm-generic/io.h is
>> > included so that it is visible within it.
>> > 
>> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>> 
>> Acked-by: David S. Miller <davem@davemloft.net>
> 
> Hi David,
> 
> can I apply your Acked-by to v2 (where I had to split this patch in 2):
> 
> https://lore.kernel.org/lkml/cover.1600254147.git.lorenzo.pieralisi@arm.com
> I am about to merge it - please let me know.

Yes, you can.
diff mbox series

Patch

diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
index 9a52d9506f80..042201c79ad1 100644
--- a/arch/sparc/include/asm/io_32.h
+++ b/arch/sparc/include/asm/io_32.h
@@ -11,6 +11,16 @@ 
 #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz)
 #define memcpy_toio(d,s,sz)   _memcpy_toio(d,s,sz)
 
+#ifdef __KERNEL__
+
+/*
+ * Bus number may be embedded in the higher bits of the physical address.
+ * This is why we have no bus number argument to ioremap().
+ */
+void __iomem *ioremap(phys_addr_t offset, size_t size);
+void iounmap(volatile void __iomem *addr);
+#endif
+
 #include <asm-generic/io.h>
 
 static inline void _memset_io(volatile void __iomem *dst,
@@ -123,12 +133,6 @@  static inline void sbus_memcpy_toio(volatile void __iomem *dst,
 
 #ifdef __KERNEL__
 
-/*
- * Bus number may be embedded in the higher bits of the physical address.
- * This is why we have no bus number argument to ioremap().
- */
-void __iomem *ioremap(phys_addr_t offset, size_t size);
-void iounmap(volatile void __iomem *addr);
 /* Create a virtual mapping cookie for an IO port range */
 void __iomem *ioport_map(unsigned long port, unsigned int nr);
 void ioport_unmap(void __iomem *);