提交 1e9d1b13 编写于 作者: J Julia Lawall 提交者: Dan Williams

drivers/dma: drop unnecesary memset

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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 3542a113
...@@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platform_device *pdev) ...@@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platform_device *pdev)
goto err_kfree; goto err_kfree;
} }
memset(dw, 0, sizeof *dw);
dw->regs = ioremap(io->start, DW_REGLEN); dw->regs = ioremap(io->start, DW_REGLEN);
if (!dw->regs) { if (!dw->regs) {
err = -ENOMEM; err = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册