summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorAndy Shevchenko2013-12-12 14:49:21 +0100
committerJ. Bruce Fields2013-12-12 17:37:17 +0100
commit056785ea51a657f55953f6b0195baac2cceb1f16 (patch)
tree081e3420752e737eb8bd9ce48b799a00e345bdef /net/sunrpc
parentnfsd: don't try to reuse an expired DRC entry off the list (diff)
downloadkernel-qcow2-linux-056785ea51a657f55953f6b0195baac2cceb1f16.tar.gz
kernel-qcow2-linux-056785ea51a657f55953f6b0195baac2cceb1f16.tar.xz
kernel-qcow2-linux-056785ea51a657f55953f6b0195baac2cceb1f16.zip
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 <andriy.shevchenko@linux.intel.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/cache.c4
1 files changed, 1 insertions, 3 deletions
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--;
}