Commit e03b9843 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()

Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent af5458b9
...@@ -94,8 +94,6 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count, ...@@ -94,8 +94,6 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count,
u32 *num_ptr) u32 *num_ptr)
{ {
u32 result = 0; u32 result = 0;
u32 val;
int ch;
int radix = 10; int radix = 10;
if ((count >= 2) && (buf[0] == '0') && if ((count >= 2) && (buf[0] == '0') &&
((buf[1] == 'x') || (buf[1] == 'X'))) { ((buf[1] == 'x') || (buf[1] == 'X'))) {
...@@ -107,17 +105,9 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count, ...@@ -107,17 +105,9 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count,
} }
while (count--) { while (count--) {
ch = *buf++; int val = hex_to_bin(*buf++);
if ((ch >= '0') && (ch <= '9')) { if (val < 0 || val >= radix)
val = ch - '0';
} else if ((ch >= 'a') && (ch <= 'f')) {
val = ch - 'a' + 10;
} else if ((ch >= 'A') && (ch <= 'F')) {
val = ch - 'A' + 10;
} else {
return -EINVAL; return -EINVAL;
}
if (val >= radix) return -EINVAL;
result *= radix; result *= radix;
result += val; result += val;
} }
......
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