[S390] cio: remove custom implementation of hex_to_bin()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 25 Oct 2010 14:10:25 +0000 (16:10 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Mon, 25 Oct 2010 14:10:17 +0000 (16:10 +0200)
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/blacklist.c

index 13cb60162e429675a2f0233e903f48ccea9d89ed..76058a5166eda01681a368f061f59afcbe609454 100644 (file)
@@ -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++;