[U-Boot] [PATCH 7/9][v2] net: tsec: Use portable types and accessors for BDs

Scott Wood
2013-10-03T18:37:08Z

On Thu, 2013-10-03 at 14:48 +0300, Claudiu Manoil wrote:
> +static inline u16 read_txbd_stat(uint idx)
> +{
> + return in_be16((u16 __iomem *)&txbd[idx].status);
> +}
> +
> +static inline void write_txbd_stat(uint idx, u16 status)
> +{
> + out_be16((u16 __iomem *)&txbd[idx].status, status);
> +}
> +
> +static inline u16 read_rxbd_stat(uint idx)
> +{
> + return in_be16((u16 __iomem *)&rxbd[idx].status);
> +}
> +
> +static inline void write_rxbd_stat(uint idx, u16 status)
> +{
> + out_be16((u16 __iomem *)&rxbd[idx].status, status);
> +}

Do you need __force on these to make sparse happy?

I'd rather see these declared as __iomem than use casts (at which point,
you probably don't need per-field accessor functions).

-Scott