drivers/dma: drop unnecesary memset
Subsystems (2)
PATCH 2/2 drivers/dma: drop unnecesary memset
From: Julia Lawall <[email protected]>
memset of 0 is not needed after kzalloc
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x;
statement S;
@@
x = kzalloc(...);
if (x = NULL) S
... when != x
-memset(x,0,...);// </smpl>
Signed-off-by Julia Lawall <[email protected]>
--- drivers/dma/dw_dmac.c | 2 -- 1 file changed, 2 deletions(-)
drivers/dma/dw_dmac.c +0 -2
@@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platfo goto err_kfree; } -memset (dw,0 ,sizeof *dw); - dw->regs =ioremap (io->start,DW_REGLEN );if (!dw->regs) { err = -ENOMEM ;
Quoted 28 lines · Julia Lawall
From: Julia Lawall <[email protected]>
memset of 0 is not needed after kzalloc
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)// <smpl>
@@
expression x;
statement S;
@@x = kzalloc(...);
if (x = NULL) S
... when != x
-memset(x,0,...);// </smpl>Signed-off-by Julia Lawall <[email protected]>--- drivers/dma/dw_dmac.c | 2 -- 1 file changed, 2 deletions(-)diff -u -p
a/drivers/dma/dw_dmac.cb/drivers/dma/dw_dmac.c
drivers/dma/dw_dmac.c static int __init dw_probe(struct platfo · line 1275
Quoted 8 lines
drivers/dma/dw_dmac.c +0
-2@@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platfo goto err_kfree; } -memset (dw,0 ,sizeof *dw); - dw->regs =ioremap (io->start,DW_REGLEN );if (!dw->regs) { err = -ENOMEM ;
Acked-by Maciej Sosnowski <[email protected]>