From: Andy Shevchenko Date: Thu, 12 Dec 2013 13:49:21 +0000 (+0200) Subject: net/sunrpc/cache: simplify code by using hex_pack_byte() X-Git-Tag: v3.14-rc1~44^2~32 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=056785ea51a657f55953f6b0195baac2cceb1f16;p=linux.git net/sunrpc/cache: simplify code by using hex_pack_byte() hex_pack_byte() is a fast way to convert a byte in its ASCII representation. We may use it instead of custom approach. Signed-off-by: Andy Shevchenko Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index a72de074172d..0877db0787b1 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1111,9 +1111,7 @@ void qword_addhex(char **bpp, int *lp, char *buf, int blen) *bp++ = 'x'; len -= 2; while (blen && len >= 2) { - unsigned char c = *buf++; - *bp++ = '0' + ((c&0xf0)>>4) + (c>=0xa0)*('a'-'9'-1); - *bp++ = '0' + (c&0x0f) + ((c&0x0f)>=0x0a)*('a'-'9'-1); + bp = hex_byte_pack(bp, *buf++); len -= 2; blen--; }