aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle/api/alloc/zalloc-simple.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/coccinelle/api/alloc/zalloc-simple.cocci')
-rw-r--r--scripts/coccinelle/api/alloc/zalloc-simple.cocci11
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/coccinelle/api/alloc/zalloc-simple.cocci b/scripts/coccinelle/api/alloc/zalloc-simple.cocci
index d819275b7fde..5cd1991c582e 100644
--- a/scripts/coccinelle/api/alloc/zalloc-simple.cocci
+++ b/scripts/coccinelle/api/alloc/zalloc-simple.cocci
@@ -69,15 +69,6 @@ statement S;
69- x = (T)vmalloc(E1); 69- x = (T)vmalloc(E1);
70+ x = (T)vzalloc(E1); 70+ x = (T)vzalloc(E1);
71| 71|
72- x = dma_alloc_coherent(E2,E1,E3,E4);
73+ x = dma_zalloc_coherent(E2,E1,E3,E4);
74|
75- x = (T *)dma_alloc_coherent(E2,E1,E3,E4);
76+ x = dma_zalloc_coherent(E2,E1,E3,E4);
77|
78- x = (T)dma_alloc_coherent(E2,E1,E3,E4);
79+ x = (T)dma_zalloc_coherent(E2,E1,E3,E4);
80|
81- x = kmalloc_node(E1,E2,E3); 72- x = kmalloc_node(E1,E2,E3);
82+ x = kzalloc_node(E1,E2,E3); 73+ x = kzalloc_node(E1,E2,E3);
83| 74|
@@ -225,7 +216,7 @@ p << r2.p;
225x << r2.x; 216x << r2.x;
226@@ 217@@
227 218
228msg="WARNING: dma_zalloc_coherent should be used for %s, instead of dma_alloc_coherent/memset" % (x) 219msg="WARNING: dma_alloc_coherent use in %s already zeroes out memory, so memset is not needed" % (x)
229coccilib.report.print_report(p[0], msg) 220coccilib.report.print_report(p[0], msg)
230 221
231//----------------------------------------------------------------- 222//-----------------------------------------------------------------