diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-09-15 16:14:05 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:50:27 -0400 |
commit | acb2cc8b20d6cb9e65c1e442d59a2449d8774157 (patch) | |
tree | 54deabaa1238049d0d0a342b7c1b08ad71155c91 | |
parent | bf1e9a080d7766bd65b8d8eb837ecde8b03dcc31 (diff) |
[PATCH] drivers/net: remove superfluous memset
This patch covers something like this:
dev = alloc_*dev(...
...
priv = netdev_priv(dev);
memset(priv, 0, sizeof(*priv));
The memset() here is superfluous. alloc_netdev() uses kzalloc()
to allocate needed memory so there is no need to zero the priv region
twice.
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 1 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 1 | ||||
-rw-r--r-- | drivers/net/sunlance.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/pegasus.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/rtl8150.c | 1 |
6 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 5dc89d507e66..2812b524edae 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -956,7 +956,6 @@ static struct net_device *fs_init_instance(struct device *dev, | |||
956 | SET_MODULE_OWNER(ndev); | 956 | SET_MODULE_OWNER(ndev); |
957 | 957 | ||
958 | fep = netdev_priv(ndev); | 958 | fep = netdev_priv(ndev); |
959 | memset(fep, 0, privsize); /* clear everything */ | ||
960 | 959 | ||
961 | fep->dev = dev; | 960 | fep->dev = dev; |
962 | dev_set_drvdata(dev, ndev); | 961 | dev_set_drvdata(dev, ndev); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 48b23c592406..6dc28b824935 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2956,7 +2956,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2956 | SET_NETDEV_DEV(netdev, &pdev->dev); | 2956 | SET_NETDEV_DEV(netdev, &pdev->dev); |
2957 | 2957 | ||
2958 | mgp = netdev_priv(netdev); | 2958 | mgp = netdev_priv(netdev); |
2959 | memset(mgp, 0, sizeof(*mgp)); | ||
2960 | mgp->dev = netdev; | 2959 | mgp->dev = netdev; |
2961 | netif_napi_add(netdev, &mgp->napi, | 2960 | netif_napi_add(netdev, &mgp->napi, |
2962 | myri10ge_poll, myri10ge_napi_weight); | 2961 | myri10ge_poll, myri10ge_napi_weight); |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index af16553e18b3..dcd66a6b4904 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -329,7 +329,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
329 | SET_NETDEV_DEV(netdev, &pdev->dev); | 329 | SET_NETDEV_DEV(netdev, &pdev->dev); |
330 | 330 | ||
331 | adapter = netdev->priv; | 331 | adapter = netdev->priv; |
332 | memset(adapter, 0 , sizeof(struct netxen_adapter)); | ||
333 | 332 | ||
334 | adapter->ahw.pdev = pdev; | 333 | adapter->ahw.pdev = pdev; |
335 | adapter->ahw.pci_func = pci_func_id; | 334 | adapter->ahw.pci_func = pci_func_id; |
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 68e4f660367d..e94b752f9f34 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -1335,7 +1335,6 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev, | |||
1335 | return -ENOMEM; | 1335 | return -ENOMEM; |
1336 | 1336 | ||
1337 | lp = netdev_priv(dev); | 1337 | lp = netdev_priv(dev); |
1338 | memset(lp, 0, sizeof(*lp)); | ||
1339 | 1338 | ||
1340 | if (sparc_lance_debug && version_printed++ == 0) | 1339 | if (sparc_lance_debug && version_printed++ == 0) |
1341 | printk (KERN_INFO "%s", version); | 1340 | printk (KERN_INFO "%s", version); |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 04cba6bf3d54..06838928ef47 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -1306,7 +1306,6 @@ static int pegasus_probe(struct usb_interface *intf, | |||
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | pegasus = netdev_priv(net); | 1308 | pegasus = netdev_priv(net); |
1309 | memset(pegasus, 0, sizeof (struct pegasus)); | ||
1310 | pegasus->dev_index = dev_index; | 1309 | pegasus->dev_index = dev_index; |
1311 | init_waitqueue_head(&pegasus->ctrl_wait); | 1310 | init_waitqueue_head(&pegasus->ctrl_wait); |
1312 | 1311 | ||
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index fa598f0340cf..3b3a57ea2676 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -905,7 +905,6 @@ static int rtl8150_probe(struct usb_interface *intf, | |||
905 | } | 905 | } |
906 | 906 | ||
907 | dev = netdev_priv(netdev); | 907 | dev = netdev_priv(netdev); |
908 | memset(dev, 0, sizeof(rtl8150_t)); | ||
909 | 908 | ||
910 | dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL); | 909 | dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL); |
911 | if (!dev->intr_buff) { | 910 | if (!dev->intr_buff) { |