Re: [PATCH 09/12] unicore32 machine related files: hardware registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 22 February 2011, Guan Xuetao wrote:
> > > diff --git a/arch/unicore32/include/mach/hardware.h b/arch/unicore32/include/mach/hardware.h
> > > index 3fb7236..ebce7de 100644
> > > --- a/arch/unicore32/include/mach/hardware.h
> > > +++ b/arch/unicore32/include/mach/hardware.h
> > > @@ -17,19 +17,14 @@
> > >
> > >  #include "PKUnity.h"
> > >
> > > -#define io_p2v(x)  ((x) - PKUNITY_IOSPACE_BASE)
> > > -#define io_v2p(x)  ((x) + PKUNITY_IOSPACE_BASE)
> > > +#define io_p2v(x)  ((x) - PKUNITY_MMIO_BASE)
> > > +#define io_v2p(x)  ((x) + PKUNITY_MMIO_BASE)
> > >
> I apply the patch as following:
> 
> @@ -22,8 +22,7 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -# define __REG(x)      (*((volatile unsigned long *)io_p2v(x)))
> -# define __PREG(x)     (io_v2p((unsigned long)&(x)))
> +# define __REG(x)      (void __iomem *)io_p2v(x)

The patch looks correct, but if you make the the definition for
PKUNITY_MMIO_BASE contain the cast to (void __iomem *), you no
longer need another cast.

> __REG reserved only for all registers prefix.
> And all using for __REG converted to readl/writel.

Fair enough.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux