Commit f2777077 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Martin Schwidefsky

[S390] cio: remove custom implementation of hex_to_bin()

Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent ed3640b2
...@@ -79,17 +79,15 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit, ...@@ -79,17 +79,15 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit,
int max_digit, int max_val) int max_digit, int max_val)
{ {
int diff; int diff;
unsigned int value;
diff = 0; diff = 0;
*val = 0; *val = 0;
while (isxdigit(**cp) && (diff <= max_digit)) { while (diff <= max_digit) {
int value = hex_to_bin(**cp);
if (isdigit(**cp)) if (value < 0)
value = **cp - '0'; break;
else
value = tolower(**cp) - 'a' + 10;
*val = *val * 16 + value; *val = *val * 16 + value;
(*cp)++; (*cp)++;
diff++; diff++;
......
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