[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <8496f91a0901181107o17ee80e7h7fab67194a7bde23@mail.gmail.com>
Date: Sun, 18 Jan 2009 22:07:56 +0300
From: "Matvejchikov Ilya" <matvejchikov@...il.com>
To: netdev@...r.kernel.org
Subject: [PATCH] net: A little dev_valid_name() improvement
This patch removes redundant complexity when checking the
network device name to be valid.
Signed-off-by: Matvejchikov Ilya <matvejchikov@...il.com>
---
net/core/dev.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 8d67597..9c5d8f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -760,12 +760,10 @@ struct net_device * dev_get_by_flags(struct net
*net, unsigned short if_flags, u
*/
int dev_valid_name(const char *name)
{
- if (*name == '\0')
+ if (*name == '\0' || *name == '.')
return 0;
if (strlen(name) >= IFNAMSIZ)
return 0;
- if (!strcmp(name, ".") || !strcmp(name, ".."))
- return 0;
while (*name) {
if (*name == '/' || isspace(*name))
--
1.6.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists