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

Scott Wood scottwood at freescale.com
Thu Oct 3 20:37:08 CEST 2013


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





More information about the U-Boot mailing list