From: Andy Shevchenko Date: Thu, 15 Jul 2010 02:37:18 +0000 (+0000) Subject: drivers: isdn: use kernel macros to convert hex digit X-Git-Tag: upstream/snapshot3+hdmi~13787^2~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=735c65ce4a878b55e08821360fdfd42753cdbe14;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drivers: isdn: use kernel macros to convert hex digit Signed-off-by: Andy Shevchenko Cc: Karsten Keil Cc: Tilman Schmidt Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index bf55ed5..2978bda 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -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'); diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c index 8b853d5..c0771f9 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) { 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);