Skip to content

Commit

Permalink
lib/bitmap.c: use hex_to_bin()
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Oct 26, 2010
1 parent 1fa7e54 commit 66f1991
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ EXPORT_SYMBOL(bitmap_find_next_zero_area);

#define CHUNKSZ 32
#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 */

/**
Expand Down Expand Up @@ -466,7 +465,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
if (chunk & ~((1UL << (CHUNKSZ - 4)) - 1))
return -EOVERFLOW;

chunk = (chunk << 4) | unhex(c);
chunk = (chunk << 4) | hex_to_bin(c);
ndigits++; totaldigits++;
}
if (ndigits == 0)
Expand Down

0 comments on commit 66f1991

Please sign in to comment.