aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/capi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/capi.c')
-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 e72f86bccaa5..8f78f15c8ef7 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;