aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/capi.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
index 20ebcee9b0c0..6643d6533ccb 100644
--- a/drivers/isdn/gigaset/capi.c
+++ b/drivers/isdn/gigaset/capi.c
@@ -171,20 +171,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
171} 171}
172 172
173/* 173/*
174 * check for legal hex digit
175 */
176static inline int ishexdigit(char c)
177{
178 if (c >= '0' && c <= '9')
179 return 1;
180 if (c >= 'A' && c <= 'F')
181 return 1;
182 if (c >= 'a' && c <= 'f')
183 return 1;
184 return 0;
185}
186
187/*
188 * convert hex to binary 174 * convert hex to binary
189 */ 175 */
190static inline u8 hex2bin(char c) 176static inline u8 hex2bin(char c)
@@ -204,7 +190,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
204{ 190{
205 int l = 0; 191 int l = 0;
206 while (*in) { 192 while (*in) {
207 if (!ishexdigit(in[0]) || !ishexdigit(in[1]) || l >= maxlen) 193 if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen)
208 return -1; 194 return -1;
209 out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]); 195 out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]);
210 in += 2; 196 in += 2;