forked from Minki/linux
[S390] cio: remove custom implementation of hex_to_bin()
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
ed3640b285
commit
f2777077aa
@ -79,17 +79,15 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit,
|
||||
int max_digit, int max_val)
|
||||
{
|
||||
int diff;
|
||||
unsigned int value;
|
||||
|
||||
diff = 0;
|
||||
*val = 0;
|
||||
|
||||
while (isxdigit(**cp) && (diff <= max_digit)) {
|
||||
while (diff <= max_digit) {
|
||||
int value = hex_to_bin(**cp);
|
||||
|
||||
if (isdigit(**cp))
|
||||
value = **cp - '0';
|
||||
else
|
||||
value = tolower(**cp) - 'a' + 10;
|
||||
if (value < 0)
|
||||
break;
|
||||
*val = *val * 16 + value;
|
||||
(*cp)++;
|
||||
diff++;
|
||||
|
Loading…
Reference in New Issue
Block a user