aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/utils.c
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2013-03-27 05:54:13 +0000
committerDavid S. Miller <[email protected]>2013-03-27 16:48:32 +0000
commit5a048e3b59fb4211b7978f78217878071c344379 (patch)
tree2de472f250062a39725f232cb5e467c12ccf53c8 /net/core/utils.c
parentbnx2x: Cosmetic changes (diff)
downloadkernel-5a048e3b59fb4211b7978f78217878071c344379.tar.gz
kernel-5a048e3b59fb4211b7978f78217878071c344379.zip
net: core: let's use native isxdigit instead of custom
In kernel we have fast and pretty implementation of the isxdigit() function. Let's use it. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/core/utils.c')
-rw-r--r--net/core/utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/utils.c b/net/core/utils.c
index e3487e461939..3c7f5b51b979 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
+#include <linux/ctype.h>
#include <linux/inet.h>
#include <linux/mm.h>
#include <linux/net.h>
@@ -348,9 +349,7 @@ int mac_pton(const char *s, u8 *mac)
/* Don't dirty result unless string is valid MAC. */
for (i = 0; i < ETH_ALEN; i++) {
- if (!strchr("0123456789abcdefABCDEF", s[i * 3]))
- return 0;
- if (!strchr("0123456789abcdefABCDEF", s[i * 3 + 1]))
+ if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
return 0;
if (i != ETH_ALEN - 1 && s[i * 3 + 2] != ':')
return 0;