From: akepner@sgi.com
To: Ingo Molnar <mingo@elte.hu>
Cc: Tony Luck <tony.luck@intel.com>,
Grant Grundler <grundler@parisc-linux.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Jes Sorensen <jes@sgi.com>,
Randy Dunlap <randy.dunlap@oracle.com>,
Roland Dreier <rdreier@cisco.com>,
James Bottomley <James.Bottomley@steeleye.com>,
David Miller <davem@davemloft.net>,
Muli Ben-Yehuda <muli@il.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC/PARTIAL PATCH 1/3] dma: create linux/dma-direction.h
Date: Tue, 8 Jan 2008 10:10:29 -0800 [thread overview]
Message-ID: <20080108181029.GY23661@sgi.com> (raw)
In-Reply-To: <20080108085831.GA27671@elte.hu>
On Tue, Jan 08, 2008 at 09:58:31AM +0100, Ingo Molnar wrote:
>
> * akepner@sgi.com <akepner@sgi.com> wrote:
>
> > +enum dma_data_attr {
> > + DMA_ATTR_BARRIER = (1 << 0),
> > + DMA_ATTR_FOO = (1 << 1),
> > + DMA_ATTR_GOO = (1 << 2),
> > + DMA_ATTR_MAX = (1 << 3),
> > +};
>
> FOO/GOO we dont need i guess ...
Right. That's example GOO ;-)
>
> > +#define DMA_FLAGS_ATTR_SHIFT 8
> > +#define DMA_FLAGS_DIR_MASK ((1 << DMA_FLAGS_ATTR_SHIFT) - 1)
> > +#define DMA_FLAGS_ATTR_MASK ~DMA_FLAGS_DIR_MASK
> > +
> > +static inline enum dma_data_direction dma_flags_get_dir(u32 fin)
> > +{
> > + return (fin & DMA_FLAGS_DIR_MASK);
> > +}
>
> the u32 looks a bit weird. Why not unsigned int ?
>
unsigned int would be fine with me.
> also, are the new dma_map_*() API compatible with the old one? I.e. does
> dma_map_*(...,0) and dma_map_*(...,1) map to the right thing? If yes
> then perhaps dont change 'int direction' to 'u32 flags' at all but just
> rename 'direction' to 'flags' and be done with it.
>
Yes, the callers don't necessarily need to be modified. Callers
of dma_map_* would only need to be changed if they want to pass
some additional attribute(s).
> also, this conversion:
>
> + enum dma_data_direction direction = dma_flags_get_dir(flags);
>
> would be unnecessary if callers passed in the bitmap already, instead of
> 'flags'. 0 and 1 would still map to the right thing i think.
>
Right, but if the caller *had* passed some optional attribute, we
probably want to strip it off (and either use it or ignore it, as
appropriate.)
--
Arthur
prev parent reply other threads:[~2008-01-08 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 2:35 [RFC/PARTIAL PATCH 1/3] dma: create linux/dma-direction.h akepner
2008-01-08 8:58 ` Ingo Molnar
2008-01-08 18:10 ` akepner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080108181029.GY23661@sgi.com \
--to=akepner@sgi.com \
--cc=James.Bottomley@steeleye.com \
--cc=davem@davemloft.net \
--cc=grundler@parisc-linux.org \
--cc=jbarnes@virtuousgeek.org \
--cc=jes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=muli@il.ibm.com \
--cc=randy.dunlap@oracle.com \
--cc=rdreier@cisco.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox