Skip to content

Commit

Permalink
drivers: isdn: use kernel macros to convert hex digit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and David S. Miller committed Jul 16, 2010
1 parent 8f31539 commit 735c65c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
7 changes: 2 additions & 5 deletions drivers/isdn/capi/capidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,12 +1450,9 @@ static void handle_dtrace_data(capidrv_contr *card,
}

for (p = data, end = data+len; p < end; p++) {
u8 w;
PUTBYTE_TO_STATUS(card, ' ');
w = (*p >> 4) & 0xf;
PUTBYTE_TO_STATUS(card, (w < 10) ? '0'+w : 'A'-10+w);
w = *p & 0xf;
PUTBYTE_TO_STATUS(card, (w < 10) ? '0'+w : 'A'-10+w);
PUTBYTE_TO_STATUS(card, hex_asc_hi(*p));
PUTBYTE_TO_STATUS(card, hex_asc_lo(*p));
}
PUTBYTE_TO_STATUS(card, '\n');

Expand Down
13 changes: 2 additions & 11 deletions drivers/isdn/hisax/q931.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,20 +1152,11 @@ QuickHex(char *txt, u_char * p, int cnt)
{
register int i;
register char *t = txt;
register u_char w;

for (i = 0; i < cnt; i++) {
*t++ = ' ';
w = (p[i] >> 4) & 0x0f;
if (w < 10)
*t++ = '0' + w;
else
*t++ = 'A' - 10 + w;
w = p[i] & 0x0f;
if (w < 10)
*t++ = '0' + w;
else
*t++ = 'A' - 10 + w;
*t++ = hex_asc_hi(p[i]);
*t++ = hex_asc_lo(p[i]);
}
*t++ = 0;
return (t - txt);
Expand Down

0 comments on commit 735c65c

Please sign in to comment.