提交 91f06e66 编写于 作者: A Andy Shevchenko 提交者: Linus Torvalds

fs: ldm: don't use own implementation of hex_to_bin()

Remove own implementation of hex_to_bin().
Signed-off-by: NAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: "Richard Russon (FlatCap)" <ldm@flatcap.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1356de06
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/kernel.h>
#include "ldm.h" #include "ldm.h"
#include "check.h" #include "check.h"
#include "msdos.h" #include "msdos.h"
...@@ -77,17 +78,16 @@ static int ldm_parse_hexbyte (const u8 *src) ...@@ -77,17 +78,16 @@ static int ldm_parse_hexbyte (const u8 *src)
int h; int h;
/* high part */ /* high part */
if ((x = src[0] - '0') <= '9'-'0') h = x; x = h = hex_to_bin(src[0]);
else if ((x = src[0] - 'a') <= 'f'-'a') h = x+10; if (h < 0)
else if ((x = src[0] - 'A') <= 'F'-'A') h = x+10; return -1;
else return -1;
h <<= 4;
/* low part */ /* low part */
if ((x = src[1] - '0') <= '9'-'0') return h | x; h = hex_to_bin(src[1]);
if ((x = src[1] - 'a') <= 'f'-'a') return h | (x+10); if (h < 0)
if ((x = src[1] - 'A') <= 'F'-'A') return h | (x+10); return -1;
return -1;
return (x << 4) + h;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册