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/7] net: core: move dev_alloc_name_ns a little higher
Date: Mon, 13 Nov 2017 00:15:05 +0100	[thread overview]
Message-ID: <20171112231511.4666-3-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20171112231511.4666-1-linux@rasmusvillemoes.dk>

No functional change.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 net/core/dev.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 87e19804757b..240ae6bc1097 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1105,6 +1105,19 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 	return -ENFILE;
 }
 
+static int dev_alloc_name_ns(struct net *net,
+			     struct net_device *dev,
+			     const char *name)
+{
+	char buf[IFNAMSIZ];
+	int ret;
+
+	ret = __dev_alloc_name(net, name, buf);
+	if (ret >= 0)
+		strlcpy(dev->name, buf, IFNAMSIZ);
+	return ret;
+}
+
 /**
  *	dev_alloc_name - allocate a name for a device
  *	@dev: device
@@ -1134,19 +1147,6 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 }
 EXPORT_SYMBOL(dev_alloc_name);
 
-static int dev_alloc_name_ns(struct net *net,
-			     struct net_device *dev,
-			     const char *name)
-{
-	char buf[IFNAMSIZ];
-	int ret;
-
-	ret = __dev_alloc_name(net, name, buf);
-	if (ret >= 0)
-		strlcpy(dev->name, buf, IFNAMSIZ);
-	return ret;
-}
-
 int dev_get_valid_name(struct net *net, struct net_device *dev,
 		       const char *name)
 {
-- 
2.11.0

  parent reply	other threads:[~2017-11-12 23:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12 23:15 [PATCH 0/7] net: core: devname allocation cleanups Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 1/7] net: core: improve sanity checking in __dev_alloc_name Rasmus Villemoes
2017-11-12 23:15 ` Rasmus Villemoes [this message]
2017-11-12 23:15 ` [PATCH 3/7] net: core: eliminate dev_alloc_name{,_ns} code duplication Rasmus Villemoes
2017-11-20 14:26   ` David Laight
2017-11-12 23:15 ` [PATCH 4/7] net: core: drop pointless check in __dev_alloc_name Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 5/7] net: core: check dev_valid_name " Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 6/7] net: core: maybe return -EEXIST " Rasmus Villemoes
2017-11-13  0:03   ` Stephen Hemminger
2017-11-12 23:15 ` [PATCH 7/7] net: core: dev_get_valid_name is now the same as dev_alloc_name_ns Rasmus Villemoes
2017-11-13  0:12 ` [PATCH 0/7] net: core: devname allocation cleanups Stephen Hemminger
2017-11-14  7:39 ` 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=20171112231511.4666-3-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

Powered by JetHome