Skip to content

Commit

Permalink
IB: Fix ib_dma_alloc_coherent() wrapper
Browse files Browse the repository at this point in the history
The ib_dma_alloc_coherent() wrapper uses a u64* for the dma_handle
parameter, unlike dma_alloc_coherent, which uses dma_addr_t*.  This
means that we need a temporary variable to handle the case when
ib_dma_alloc_coherent() just falls through directly to
dma_alloc_coherent() on architectures where sizeof u64 != sizeof
dma_addr_t.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Dec 15, 2006
1 parent d1998ef commit c59a3da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,14 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev,
{
if (dev->dma_ops)
return dev->dma_ops->alloc_coherent(dev, size, dma_handle, flag);
return dma_alloc_coherent(dev->dma_device, size, dma_handle, flag);
else {
dma_addr_t handle;
void *ret;

ret = dma_alloc_coherent(dev->dma_device, size, &handle, flag);
*dma_handle = handle;
return ret;
}
}

/**
Expand Down

0 comments on commit c59a3da

Please sign in to comment.