Re: [PATCH v2 06/29] nios2: I/O Mapping

Ley Foon Tan
2014-07-15T10:51:17Z

On Tue, Jul 15, 2014 at 5:22 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 15 July 2014 16:45:33 Ley Foon Tan wrote:
>> +#ifdef __IO_USE_DUFFS
>> +
>> +/* Use "Duff's Device" to unroll the loops. */
>> +#define __IO_OUT_LOOP(a, b, l) \
>> + do { \
>
> The I/O loops can probably better go into the C file that uses them.
Okay.

>
> These should either use inline functions or macros that behave like them,
> to avoid miscompilation. The normal way to define those macros is
>
> #define inb(a) ({ 0; })
> #define outb(x, a) do { } while (0)
Okay, will update these.

>
>> +static inline void __iomem *ioremap_writethrough(unsigned long physaddr,
>> + unsigned long size)
>> +{
>> + return __ioremap(physaddr, size, 0);
>> +}
>
> ioremap_writethrough() is not a standard interface, just drop it.
Okay, will drop this.
>
>> +static inline void __iomem *ioremap_fullcache(unsigned long physaddr,
>> + unsigned long size)
>> +{
>> + return __ioremap(physaddr, size, _PAGE_CACHED);
>> +}
>
> This is more commonly called ioremap_cache().
>
> ioremap_fullcache() is defined on some architectures but never used. If
> you don't use this in your own code, you can drop it as well.

We are not using ioremap_fullcache(), will drop it.

Thanks.

Regards
Ley Foon