On Wed, Aug 6, 2008 at 2:16 AM, Li Yang <[EMAIL PROTECTED]> wrote:

> +/*---------------------------------------------------------------------
> + *             Mask definitions for usb BD                           *
> + *--------------------------------------------------------------------*/
> +#define QE_SIZEOF_BD       sizeof(struct qe_bd)
> +
> +#define BD_BUFFER_ARG(bd)                   (((struct qe_bd *)bd)->buf)
> +#define BD_BUFFER_CLEAR(bd)                 out_be32(&(BD_BUFFER_ARG(bd)), 
> 0);
> +#define BD_BUFFER(bd)                       in_be32(&(BD_BUFFER_ARG(bd)))
> +#define BD_STATUS_AND_LENGTH_SET(bd, val)   out_be32((u32 *)bd, val)
> +#define BD_STATUS_AND_LENGTH(bd)            in_be32((u32 *)bd)
> +#define BD_BUFFER_SET(bd, buffer)           out_be32(&(BD_BUFFER_ARG(bd)), \
> +                                                       (u32)(buffer))

Delete all of these.  Don't use these silly macros at all.  Reference
the structure fields directly, and use the in_ and out_ functions
directly.

Using macros like these encourages unnecessary typecasts.  "struct
qe_bd" has been defined, so you should use it.

-- 
Timur Tabi
Linux kernel developer at Freescale
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to