[PATCH 2/2] Re-added support for FEC on MPC5121 from Freescale LTIB to current head

Grant Likely grant.likely at secretlab.ca
Thu Jun 12 23:54:08 EST 2008


On Thu, Jun 12, 2008 at 5:45 AM, David Jander <david.jander at protonic.nl> wrote:
>
>
>  /* write */
> -#define CBDW_SC(_cbd, _sc)             __cbd_out16(&(_cbd)->cbd_sc, (_sc))
> -#define CBDW_DATLEN(_cbd, _datlen)     __cbd_out16(&(_cbd)->cbd_datlen, (_datlen))
> -#define CBDW_BUFADDR(_cbd, _bufaddr)   __cbd_out32(&(_cbd)->cbd_bufaddr, (_bufaddr))
> +#define CBDW_SC(_cbd, _sc)             __cbd_out16((volatile void __iomem *)&(_cbd)->cbd_sc, (_sc))
> +#define CBDW_DATLEN(_cbd, _datlen)     __cbd_out16((volatile void __iomem *)&(_cbd)->cbd_datlen, (_datlen))
> +#define CBDW_BUFADDR(_cbd, _bufaddr)   __cbd_out32((volatile void __iomem *)&(_cbd)->cbd_bufaddr, (_bufaddr))
>
>  /* read */
> -#define CBDR_SC(_cbd)                  __cbd_in16(&(_cbd)->cbd_sc)
> -#define CBDR_DATLEN(_cbd)              __cbd_in16(&(_cbd)->cbd_datlen)
> -#define CBDR_BUFADDR(_cbd)             __cbd_in32(&(_cbd)->cbd_bufaddr)
> +#define CBDR_SC(_cbd)                  __cbd_in16((volatile void __iomem *)&(_cbd)->cbd_sc)
> +#define CBDR_DATLEN(_cbd)              __cbd_in16((volatile void __iomem *)&(_cbd)->cbd_datlen)
> +#define CBDR_BUFADDR(_cbd)             __cbd_in32((volatile void __iomem *)&(_cbd)->cbd_bufaddr)

Another comment: This really doesn't look right.  The _cbd pointer
passed in should already be tagged with __iomem.  Trying to fix it
here is a band-aid and unsafe.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the Linuxppc-embedded mailing list