mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 09:32:36 -04:00
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:
committed by
Christoph Hellwig
parent
07a85fe142
commit
dfd32cad14
@@ -69,15 +69,6 @@ statement S;
|
||||
- x = (T)vmalloc(E1);
|
||||
+ x = (T)vzalloc(E1);
|
||||
|
|
||||
- x = dma_alloc_coherent(E2,E1,E3,E4);
|
||||
+ x = dma_zalloc_coherent(E2,E1,E3,E4);
|
||||
|
|
||||
- x = (T *)dma_alloc_coherent(E2,E1,E3,E4);
|
||||
+ x = dma_zalloc_coherent(E2,E1,E3,E4);
|
||||
|
|
||||
- x = (T)dma_alloc_coherent(E2,E1,E3,E4);
|
||||
+ x = (T)dma_zalloc_coherent(E2,E1,E3,E4);
|
||||
|
|
||||
- x = kmalloc_node(E1,E2,E3);
|
||||
+ x = kzalloc_node(E1,E2,E3);
|
||||
|
|
||||
@@ -225,7 +216,7 @@ p << r2.p;
|
||||
x << r2.x;
|
||||
@@
|
||||
|
||||
msg="WARNING: dma_zalloc_coherent should be used for %s, instead of dma_alloc_coherent/memset" % (x)
|
||||
msg="WARNING: dma_alloc_coherent use in %s already zeroes out memory, so memset is not needed" % (x)
|
||||
coccilib.report.print_report(p[0], msg)
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user