Browse Source

lib/bitmap.c: use hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Shevchenko 14 năm trước cách đây
mục cha
commit
66f1991bc2
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      lib/bitmap.c

+ 1 - 2
lib/bitmap.c

@@ -359,7 +359,6 @@ EXPORT_SYMBOL(bitmap_find_next_zero_area);
 
 
 #define CHUNKSZ				32
 #define CHUNKSZ				32
 #define nbits_to_hold_value(val)	fls(val)
 #define nbits_to_hold_value(val)	fls(val)
-#define unhex(c)			(isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10))
 #define BASEDEC 10		/* fancier cpuset lists input in decimal */
 #define BASEDEC 10		/* fancier cpuset lists input in decimal */
 
 
 /**
 /**
@@ -466,7 +465,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
 			if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1))
 			if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1))
 				return -EOVERFLOW;
 				return -EOVERFLOW;
 
 
-			chunk = (chunk << 4) | unhex(c);
+			chunk = (chunk << 4) | hex_to_bin(c);
 			ndigits++; totaldigits++;
 			ndigits++; totaldigits++;
 		}
 		}
 		if (ndigits == 0)
 		if (ndigits == 0)