diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-10-26 17:23:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 19:52:18 -0400 |
commit | 66f1991bc2357436498ac990302b6f5bf403d7ef (patch) | |
tree | 1b98628c3863b23f81f9475d7c29f096206512c6 /lib/bitmap.c | |
parent | 1fa7e5473cba543b02a396ced9e407f614bb117c (diff) |
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>
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r-- | lib/bitmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index ffb78c916ccd..741fae905ae3 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
@@ -359,7 +359,6 @@ EXPORT_SYMBOL(bitmap_find_next_zero_area); | |||
359 | 359 | ||
360 | #define CHUNKSZ 32 | 360 | #define CHUNKSZ 32 |
361 | #define nbits_to_hold_value(val) fls(val) | 361 | #define nbits_to_hold_value(val) fls(val) |
362 | #define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10)) | ||
363 | #define BASEDEC 10 /* fancier cpuset lists input in decimal */ | 362 | #define BASEDEC 10 /* fancier cpuset lists input in decimal */ |
364 | 363 | ||
365 | /** | 364 | /** |
@@ -466,7 +465,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen, | |||
466 | if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1)) | 465 | if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1)) |
467 | return -EOVERFLOW; | 466 | return -EOVERFLOW; |
468 | 467 | ||
469 | chunk = (chunk << 4) | unhex(c); | 468 | chunk = (chunk << 4) | hex_to_bin(c); |
470 | ndigits++; totaldigits++; | 469 | ndigits++; totaldigits++; |
471 | } | 470 | } |
472 | if (ndigits == 0) | 471 | if (ndigits == 0) |