RE: [PATCH 2/2] drivers/dma: drop unnecesary memset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Julia Lawall wrote:
> From: Julia Lawall <julia@xxxxxxx>
> 
> 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@xxxxxxx>
> 
> ---
>  drivers/dma/dw_dmac.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff -u -p a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -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 <maciej.sosnowski@xxxxxxxxx>--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux