Skip to content

Commit

Permalink
V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Andy Shevchenko authored and Mauro Carvalho Chehab committed Aug 9, 2010
1 parent af5458b commit e03b984
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/media/video/pvrusb2/pvrusb2-debugifc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count,
u32 *num_ptr)
{
u32 result = 0;
u32 val;
int ch;
int radix = 10;
if ((count >= 2) && (buf[0] == '0') &&
((buf[1] == 'x') || (buf[1] == 'X'))) {
Expand All @@ -107,17 +105,9 @@ static int debugifc_parse_unsigned_number(const char *buf,unsigned int count,
}

while (count--) {
ch = *buf++;
if ((ch >= '0') && (ch <= '9')) {
val = ch - '0';
} else if ((ch >= 'a') && (ch <= 'f')) {
val = ch - 'a' + 10;
} else if ((ch >= 'A') && (ch <= 'F')) {
val = ch - 'A' + 10;
} else {
int val = hex_to_bin(*buf++);
if (val < 0 || val >= radix)
return -EINVAL;
}
if (val >= radix) return -EINVAL;
result *= radix;
result += val;
}
Expand Down

0 comments on commit e03b984

Please sign in to comment.