Skip to content

Commit

Permalink
Staging: otus: drop redundant memset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed May 11, 2010
1 parent b7e7031 commit 8d1fe5e
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/staging/otus/wwrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@ int zfLnxCencSendMsg(struct sock *netlink_sk, u_int8_t *msg, int len)
/*填写数据报相关信息*/
nlh = NLMSG_PUT(skb, 0, 0, WAI_K_MSG, size-sizeof(*nlh));
pos = NLMSG_DATA(nlh);
memset(pos, 0, len);

/*传输到用户空间的数据*/
memcpy(pos, msg, len);
Expand Down

0 comments on commit 8d1fe5e

Please sign in to comment.