dma-mapping: remove dma_zalloc_coherent()

dma_zalloc_coherent() is no longer needed as it has no users because
dma_alloc_coherent() already zeroes out memory for us.

The Coccinelle grammar rule that used to check for dma_alloc_coherent()
+ memset() is modified so that it just tells the user that the memset is
not needed anymore.

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Luis Chamberlain 2018-12-19 12:30:34 -08:00 committed by Christoph Hellwig
parent 07a85fe142
commit dfd32cad14
3 changed files with 5 additions and 23 deletions

View file

@ -717,15 +717,6 @@ static inline unsigned long dma_max_pfn(struct device *dev)
}
#endif
/*
* Please always use dma_alloc_coherent instead as it already zeroes the memory!
*/
static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
return dma_alloc_coherent(dev, size, dma_handle, flag);
}
static inline int dma_get_cache_alignment(void)
{
#ifdef ARCH_DMA_MINALIGN