projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0ef5e1
)
net/sunrpc/cache: simplify code by using hex_pack_byte()
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Thu, 12 Dec 2013 13:49:21 +0000
(15:49 +0200)
committer
J. Bruce Fields
<bfields@redhat.com>
Thu, 12 Dec 2013 16:37:17 +0000
(11:37 -0500)
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>
net/sunrpc/cache.c
patch
|
blob
|
blame
|
history
diff --git
a/net/sunrpc/cache.c
b/net/sunrpc/cache.c
index a72de074172d81a031305dae2f1551b22d9ced36..0877db0787b104e51a40ca0649dd4f9a76a44899 100644
(file)
--- 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--;
}