mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: "David S. Miller" <davem@davemloft.net>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] net: use dev_alloc_name_ns instead of dev_get_valid_name
Date: Tue, 21 Nov 2017 01:34:38 +0100	[thread overview]
Message-ID: <20171121003439.10974-2-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20171121003439.10974-1-linux@rasmusvillemoes.dk>

The latter is simply a wrapper for the former; no need to keep both, so
call dev_alloc_name_ns directly.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/net/tun.c | 2 +-
 net/core/dev.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6bb1e604aadd..849a95505f80 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2253,7 +2253,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
 		if (!dev)
 			return -ENOMEM;
-		err = dev_get_valid_name(net, dev, name);
+		err = dev_alloc_name_ns(net, dev, name);
 		if (err < 0)
 			goto err_free_dev;
 
diff --git a/net/core/dev.c b/net/core/dev.c
index 9575e7329823..0de42f39d280 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1183,7 +1183,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
 
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
-	err = dev_get_valid_name(net, dev, newname);
+	err = dev_alloc_name_ns(net, dev, newname);
 	if (err < 0) {
 		write_seqcount_end(&devnet_rename_seq);
 		return err;
@@ -7615,7 +7615,7 @@ int register_netdevice(struct net_device *dev)
 	spin_lock_init(&dev->addr_list_lock);
 	netdev_set_addr_lockdep_class(dev);
 
-	ret = dev_get_valid_name(net, dev, dev->name);
+	ret = dev_alloc_name_ns(net, dev, dev->name);
 	if (ret < 0)
 		goto out;
 
@@ -8354,7 +8354,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 		/* We get here if we can't use the current device name */
 		if (!pat)
 			goto out;
-		if (dev_get_valid_name(net, dev, pat) < 0)
+		if (dev_alloc_name_ns(net, dev, pat) < 0)
 			goto out;
 	}
 
-- 
2.11.0

  reply	other threads:[~2017-11-21  0:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  0:34 [PATCH 1/3] net: core: export dev_alloc_name_ns Rasmus Villemoes
2017-11-21  0:34 ` Rasmus Villemoes [this message]
2017-11-21  0:34 ` [PATCH 3/3] net: core: remove dev_get_valid_name Rasmus Villemoes
2017-11-24 20:11 ` [PATCH 1/3] net: core: export dev_alloc_name_ns David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171121003439.10974-2-linux@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®