From f2777077aa1f6f8a7c76b83f240975289a9fb894 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 25 Oct 2010 16:10:25 +0200 Subject: [PATCH] [S390] cio: remove custom implementation of hex_to_bin() Signed-off-by: Andy Shevchenko Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/blacklist.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index 13cb60162e4..76058a5166e 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c @@ -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++; -- 2.20.1