[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>
This commit is contained in:
committed by
David S. Miller
parent
bf1e9a080d
commit
acb2cc8b20
@@ -1306,7 +1306,6 @@ static int pegasus_probe(struct usb_interface *intf,
|
||||
}
|
||||
|
||||
pegasus = netdev_priv(net);
|
||||
memset(pegasus, 0, sizeof (struct pegasus));
|
||||
pegasus->dev_index = dev_index;
|
||||
init_waitqueue_head(&pegasus->ctrl_wait);
|
||||
|
||||
|
@@ -905,7 +905,6 @@ static int rtl8150_probe(struct usb_interface *intf,
|
||||
}
|
||||
|
||||
dev = netdev_priv(netdev);
|
||||
memset(dev, 0, sizeof(rtl8150_t));
|
||||
|
||||
dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
|
||||
if (!dev->intr_buff) {
|
||||
|
Reference in New Issue
Block a user