提交 0496b55c 编写于 作者: A Andy Shevchenko 提交者: Linus Torvalds

drivers: isdn: use new hex_to_bin() method

Remove own implementation of hex_to_bin().
Signed-off-by: NAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: NTilman Schmidt <tilman@imap.cc>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 90378889
...@@ -169,17 +169,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param, ...@@ -169,17 +169,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
msgname, paramname); msgname, paramname);
} }
/*
* convert hex to binary
*/
static inline u8 hex2bin(char c)
{
int result = c & 0x0f;
if (c & 0x40)
result += 9;
return result;
}
/* /*
* convert an IE from Gigaset hex string to ETSI binary representation * convert an IE from Gigaset hex string to ETSI binary representation
* including length byte * including length byte
...@@ -191,7 +180,7 @@ static int encode_ie(char *in, u8 *out, int maxlen) ...@@ -191,7 +180,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
while (*in) { while (*in) {
if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen) if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen)
return -1; return -1;
out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]); out[++l] = (hex_to_bin(in[0]) << 4) + hex_to_bin(in[1]);
in += 2; in += 2;
} }
out[0] = l; out[0] = l;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册