[PATCH] powerpc: Change archdata dma_data type to dma_addr_t

Michael Ellerman michael at ellerman.id.au
Thu Aug 27 00:08:45 EST 2009


On Wed, 2009-08-26 at 22:29 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2009-08-24 at 21:48 +0200, Christoph Hellwig wrote:
> > On Mon, Aug 24, 2009 at 11:17:14AM -0500, Becky Bruce wrote:
> > > Previously, this was specified as a void *, but that's not
> > > large enough on 32-bit systems with 36-bit physical
> > > addressing support.  Change the type to dma_addr_t so it
> > > will scale based on the size of a dma address.
> > 
> > This looks extreml ugly to me.  It seems like the typical use is to
> > store a pointer to a structure.  So what about making the direct
> > dma case follow that general scheme instead?
> > 
> > E.g. declare a
> > 
> > struct direct_dma_data {
> > 	dma_addr_t	direct_dma_offset;
> > };
> > 
> > and have one normal instace of it, and one per weird cell device.
> 
> Right, but we want to avoid a structure for the classic case of 32-bit
> systems with no iommu... 
> 
> I wouldn't mind doing a union here. 

That might be best, the patch as it stands is a horrible mess of casts.

Stashing a dma_addr_t into a void * is sort of gross, but storing a
pointer to some struct (a void *) in a dma_addr_t is _really_ gross :)

cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090827/c7fdf047/attachment-0001.pgp>


More information about the Linuxppc-dev mailing list