From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.224]) by ozlabs.org (Postfix) with ESMTP id E26D4DE801 for ; Thu, 7 Aug 2008 01:47:54 +1000 (EST) Received: by wr-out-0506.google.com with SMTP id c48so2292255wra.1 for ; Wed, 06 Aug 2008 08:47:53 -0700 (PDT) Message-ID: Date: Wed, 6 Aug 2008 10:47:53 -0500 From: "Timur Tabi" Sender: timur.tabi@gmail.com To: "Li Yang" Subject: Re: [PATCH] usb: add Freescale QE/CPM USB peripheral controller driver In-Reply-To: <1218007000-27320-1-git-send-email-leoli@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 References: <1218007000-27320-1-git-send-email-leoli@freescale.com> Cc: david-b@pacbell.net, linuxppc-dev@ozlabs.org, gregkh@suse.de, linux-usb@vger.kernel.org, Xie Xiaobo List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Aug 6, 2008 at 2:16 AM, Li Yang 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