lib: add error checking to hex2bin
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 20 Sep 2011 15:23:49 +0000 (11:23 -0400)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Wed, 21 Sep 2011 03:24:44 +0000 (23:24 -0400)
hex2bin converts a hexadecimal string to its binary representation.
The original version of hex2bin did not do any error checking.  This
patch adds error checking and returns the result.

Changelog v1:
- removed unpack_hex_byte()
- changed return code from boolean to int

Changelog:
- use the new unpack_hex_byte()
- add __must_check compiler option (Andy Shevchenko's suggestion)
- change function API to return error checking result
  (based on Tetsuo Handa's initial patch)

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

No differences found