Skip to content

Commit 7f0fee2

Browse files
author
Christoph Hellwig
committed
dma-mapping: merge dma_unmap_page_attrs and dma_unmap_single_attrs
The two functions are exactly the same, so don't bother implementing them twice. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Tested-by: Jesper Dangaard Brouer <brouer@redhat.com> Tested-by: Tony Luck <tony.luck@intel.com>
1 parent 8d59b5f commit 7f0fee2

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

‎include/linux/dma-mapping.h‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
253253
debug_dma_unmap_page(dev, addr, size, dir, true);
254254
}
255255

256+
static inline void dma_unmap_page_attrs(struct device *dev, dma_addr_t addr,
257+
size_t size, enum dma_data_direction dir, unsigned long attrs)
258+
{
259+
return dma_unmap_single_attrs(dev, addr, size, dir, attrs);
260+
}
261+
256262
/*
257263
* dma_maps_sg_attrs returns 0 on error and > 0 on success.
258264
* It should never return a value < 0.
@@ -300,19 +306,6 @@ static inline dma_addr_t dma_map_page_attrs(struct device *dev,
300306
return addr;
301307
}
302308

303-
static inline void dma_unmap_page_attrs(struct device *dev,
304-
dma_addr_t addr, size_t size,
305-
enum dma_data_direction dir,
306-
unsigned long attrs)
307-
{
308-
const struct dma_map_ops *ops = get_dma_ops(dev);
309-
310-
BUG_ON(!valid_dma_direction(dir));
311-
if (ops->unmap_page)
312-
ops->unmap_page(dev, addr, size, dir, attrs);
313-
debug_dma_unmap_page(dev, addr, size, dir, false);
314-
}
315-
316309
static inline dma_addr_t dma_map_resource(struct device *dev,
317310
phys_addr_t phys_addr,
318311
size_t size,

0 commit comments

Comments
 (0)