Skip to content

Commit

Permalink
drivers/dma: drop unnecesary memset
Browse files Browse the repository at this point in the history
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 <julia@diku.dk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Julia Lawall authored and Dan Williams committed Dec 22, 2009
1 parent 3542a11 commit 1e9d1b1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/dma/dw_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platform_device *pdev)
goto err_kfree;
}

memset(dw, 0, sizeof *dw);

dw->regs = ioremap(io->start, DW_REGLEN);
if (!dw->regs) {
err = -ENOMEM;
Expand Down

0 comments on commit 1e9d1b1

Please sign in to comment.