diff options
author | Julia Lawall <julia@diku.dk> | 2010-03-09 12:14:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-15 23:47:03 +0100 |
commit | 876e956f207373f974f2808c36aabcd4e32c9ee4 (patch) | |
tree | 98ea73adefeecf951fe0d3d4afa825356c46f13c /drivers/net/s2io.c | |
parent | i4l: change magic numbers in Eicon DIVA ISDN driver to symbolic names (diff) | |
download | linux-876e956f207373f974f2808c36aabcd4e32c9ee4.tar.xz linux-876e956f207373f974f2808c36aabcd4e32c9ee4.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/s2io.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index df70657260dd..2eb7f8a0d926 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -5819,10 +5819,8 @@ static void s2io_vpd_read(struct s2io_nic *nic) } } - if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) { - memset(nic->product_name, 0, vpd_data[1]); + if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) memcpy(nic->product_name, &vpd_data[3], vpd_data[1]); - } kfree(vpd_data); swstats->mem_freed += 256; } |