Commit 451e07a2 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by David S. Miller

net: core: don't use own hex_to_bin() method

Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 882d829a
...@@ -1434,18 +1434,12 @@ static ssize_t pktgen_if_write(struct file *file, ...@@ -1434,18 +1434,12 @@ static ssize_t pktgen_if_write(struct file *file,
i += len; i += len;
for (*m = 0; *v && m < pkt_dev->dst_mac + 6; v++) { for (*m = 0; *v && m < pkt_dev->dst_mac + 6; v++) {
if (*v >= '0' && *v <= '9') { int value;
*m *= 16;
*m += *v - '0'; value = hex_to_bin(*v);
} if (value >= 0)
if (*v >= 'A' && *v <= 'F') { *m = *m * 16 + value;
*m *= 16;
*m += *v - 'A' + 10;
}
if (*v >= 'a' && *v <= 'f') {
*m *= 16;
*m += *v - 'a' + 10;
}
if (*v == ':') { if (*v == ':') {
m++; m++;
*m = 0; *m = 0;
...@@ -1476,18 +1470,12 @@ static ssize_t pktgen_if_write(struct file *file, ...@@ -1476,18 +1470,12 @@ static ssize_t pktgen_if_write(struct file *file,
i += len; i += len;
for (*m = 0; *v && m < pkt_dev->src_mac + 6; v++) { for (*m = 0; *v && m < pkt_dev->src_mac + 6; v++) {
if (*v >= '0' && *v <= '9') { int value;
*m *= 16;
*m += *v - '0'; value = hex_to_bin(*v);
} if (value >= 0)
if (*v >= 'A' && *v <= 'F') { *m = *m * 16 + value;
*m *= 16;
*m += *v - 'A' + 10;
}
if (*v >= 'a' && *v <= 'f') {
*m *= 16;
*m += *v - 'a' + 10;
}
if (*v == ':') { if (*v == ':') {
m++; m++;
*m = 0; *m = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment