Commit 876e956f207373f974f2808c36aabcd4e32c9ee4

Authored by Julia Lawall
Committed by David S. Miller
1 parent 255f5c327e

drivers/net: 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: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff

... ... @@ -5819,10 +5819,8 @@
5819 5819 }
5820 5820 }
5821 5821  
5822   - if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) {
5823   - memset(nic->product_name, 0, vpd_data[1]);
  5822 + if ((!fail) && (vpd_data[1] < VPD_STRING_LEN))
5824 5823 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
5825   - }
5826 5824 kfree(vpd_data);
5827 5825 swstats->mem_freed += 256;
5828 5826 }