Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: otus: drop redundant memset

The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Julia Lawall and committed by
Greg Kroah-Hartman
8d1fe5ea b7e7031a

-1
-1
drivers/staging/otus/wwrap.c
··· 956 956 /*��д���ݱ������Ϣ*/ 957 957 nlh = NLMSG_PUT(skb, 0, 0, WAI_K_MSG, size-sizeof(*nlh)); 958 958 pos = NLMSG_DATA(nlh); 959 - memset(pos, 0, len); 960 959 961 960 /*���䵽�û��ռ������*/ 962 961 memcpy(pos, msg, len);