Re: [PATCH v5 02/39] openrisc: add ioremap_nocache declaration before include asm-generic/io.h and sync ioremap prototype with it.

From: Stafford Horne
Date: Wed Jan 03 2018 - 09:38:13 EST


Hello,

On Tue, Jan 02, 2018 at 04:24:34PM +0800, Greentime Hu wrote:
> From: Greentime Hu <greentime@xxxxxxxxxxxxx>
>
> It will be built failed if commit id: d25ea659 is selected. This patch can fix this
> build error.

Ideally you would mention the commit description since the id is not yet
usptream. I found it here (its 1 in this series):

https://github.com/andestech/linux/commit/d25ea659
asm-generic/io.h: move ioremap_nocache/ioremap_uc/ioremap_wc/ioremap_...

> Signed-off-by: Greentime Hu <greentime@xxxxxxxxxxxxx>
> ---
> arch/openrisc/include/asm/io.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/openrisc/include/asm/io.h b/arch/openrisc/include/asm/io.h
> index 7c69139..6709b28 100644
> --- a/arch/openrisc/include/asm/io.h
> +++ b/arch/openrisc/include/asm/io.h
> @@ -29,13 +29,14 @@
> #define PIO_OFFSET 0
> #define PIO_MASK 0
>
> +#define ioremap_nocache ioremap_nocache
> #include <asm-generic/io.h>

Ideally we could move <asm-generic/io.h> include down to the bottom of the file
and not have to do the defines like like this, it seems clumsy to me. In
'cris', 'nios2' and other architectures I can see they have the generic include
at the bottom of the file and not need for #define's.

I tried that but I get a lot of errors. Does your patch to asm-generic/io.h
cause build issues for those architectures as well?

-Stafford

> #include <asm/pgtable.h>
>
> extern void __iomem *__ioremap(phys_addr_t offset, unsigned long size,
> pgprot_t prot);
>
> -static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
> +static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
> {
> return __ioremap(offset, size, PAGE_KERNEL);
> }
> --
> 1.7.9.5
>