Skip to contentSkip to conversation

veth: remove redundant call of dev_alloc_name

PATCH Applied Hong Zhiguo 2 participants 2 messages Jun 9, 2013 – Jun 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 veth: remove redundant call of dev_alloc_name

it's called in the following register_netdevice. No need to call it here.
Tested with "ip link add type veth" and "ip link add xxx%d type veth".

---
 drivers/net/veth.c |    7 -------
 1 file changed, 7 deletions(-)
drivers/net/veth.c +0 -7
index 177f911..da86652 100644
@@ -379,12 +379,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 	else
 		snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
 
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			goto err_alloc_name;
-	}
-
 	err = register_netdevice(dev);
 	if (err < 0)
 		goto err_register_dev;
@@ -404,7 +398,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 err_register_dev:
 	/* nothing to do */
-err_alloc_name:
 err_configure_peer:
 	unregister_netdevice(peer);
 	return err;
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw

From: Hong Zhiguo <[email protected]>
Date: Sun, 9 Jun 2013 20:15:20 +0800

Quoted 5 lines

it's called in the following register_netdevice. No need to call it here.
Tested with "ip link add type veth" and "ip link add xxx%d type veth".

Applied, thank you.