aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>2010-05-24 17:33:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:05 -0400
commit0496b55c56d0be80e27f417f66690d97e5370f86 (patch)
tree312292995523258b5321f205f5d705a0ca148f15 /drivers/isdn
parent903788892ea0fc7fcaf7e8e5fac9a77379fc215b (diff)
drivers: isdn: use new hex_to_bin() method
Remove own implementation of hex_to_bin(). Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Acked-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/capi.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
index 964a55fb1486..ac4cfeed3946 100644
--- a/drivers/isdn/gigaset/capi.c
+++ b/drivers/isdn/gigaset/capi.c
@@ -170,17 +170,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
170} 170}
171 171
172/* 172/*
173 * convert hex to binary
174 */
175static inline u8 hex2bin(char c)
176{
177 int result = c & 0x0f;
178 if (c & 0x40)
179 result += 9;
180 return result;
181}
182
183/*
184 * convert an IE from Gigaset hex string to ETSI binary representation 173 * convert an IE from Gigaset hex string to ETSI binary representation
185 * including length byte 174 * including length byte
186 * return value: result length, -1 on error 175 * return value: result length, -1 on error
@@ -191,7 +180,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
191 while (*in) { 180 while (*in) {
192 if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen) 181 if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen)
193 return -1; 182 return -1;
194 out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]); 183 out[++l] = (hex_to_bin(in[0]) << 4) + hex_to_bin(in[1]);
195 in += 2; 184 in += 2;
196 } 185 }
197 out[0] = l; 186 out[0] = l;