diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-07-14 22:37:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-15 22:05:24 -0400 |
commit | 735c65ce4a878b55e08821360fdfd42753cdbe14 (patch) | |
tree | 3ea8202ebfb703fc16b65dc4dfbc717bb2541cee /drivers/isdn/hisax/q931.c | |
parent | 8f31539dfa36d8cf880576348d149af0cc1d788a (diff) |
drivers: isdn: use kernel macros to convert hex digit
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hisax/q931.c')
-rw-r--r-- | drivers/isdn/hisax/q931.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c index 8b853d58e820..c0771f98fa11 100644 --- a/drivers/isdn/hisax/q931.c +++ b/drivers/isdn/hisax/q931.c | |||
@@ -1152,20 +1152,11 @@ QuickHex(char *txt, u_char * p, int cnt) | |||
1152 | { | 1152 | { |
1153 | register int i; | 1153 | register int i; |
1154 | register char *t = txt; | 1154 | register char *t = txt; |
1155 | register u_char w; | ||
1156 | 1155 | ||
1157 | for (i = 0; i < cnt; i++) { | 1156 | for (i = 0; i < cnt; i++) { |
1158 | *t++ = ' '; | 1157 | *t++ = ' '; |
1159 | w = (p[i] >> 4) & 0x0f; | 1158 | *t++ = hex_asc_hi(p[i]); |
1160 | if (w < 10) | 1159 | *t++ = hex_asc_lo(p[i]); |
1161 | *t++ = '0' + w; | ||
1162 | else | ||
1163 | *t++ = 'A' - 10 + w; | ||
1164 | w = p[i] & 0x0f; | ||
1165 | if (w < 10) | ||
1166 | *t++ = '0' + w; | ||
1167 | else | ||
1168 | *t++ = 'A' - 10 + w; | ||
1169 | } | 1160 | } |
1170 | *t++ = 0; | 1161 | *t++ = 0; |
1171 | return (t - txt); | 1162 | return (t - txt); |