提交 55036ba7 编写于 作者: A Andy Shevchenko 提交者: Linus Torvalds

lib: rename pack_hex_byte() to hex_byte_pack()

As suggested by Andrew Morton in [1] there is better to have most
significant part first in the function name.

[1] https://lkml.org/lkml/2011/9/20/22

There is no functional change.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Mimi Zohar <zohar@us.ibm.com>
Cc: James Morris <jmorris@namei.org>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 66f6958e
...@@ -372,13 +372,18 @@ extern const char hex_asc[]; ...@@ -372,13 +372,18 @@ extern const char hex_asc[];
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] #define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
static inline char *pack_hex_byte(char *buf, u8 byte) static inline char *hex_byte_pack(char *buf, u8 byte)
{ {
*buf++ = hex_asc_hi(byte); *buf++ = hex_asc_hi(byte);
*buf++ = hex_asc_lo(byte); *buf++ = hex_asc_lo(byte);
return buf; return buf;
} }
static inline char * __deprecated pack_hex_byte(char *buf, u8 byte)
{
return hex_byte_pack(buf, byte);
}
extern int hex_to_bin(char ch); extern int hex_to_bin(char ch);
extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
......
...@@ -547,7 +547,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr, ...@@ -547,7 +547,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr,
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
p = pack_hex_byte(p, addr[i]); p = hex_byte_pack(p, addr[i]);
if (fmt[0] == 'M' && i != 5) if (fmt[0] == 'M' && i != 5)
*p++ = separator; *p++ = separator;
} }
...@@ -667,13 +667,13 @@ char *ip6_compressed_string(char *p, const char *addr) ...@@ -667,13 +667,13 @@ char *ip6_compressed_string(char *p, const char *addr)
lo = word & 0xff; lo = word & 0xff;
if (hi) { if (hi) {
if (hi > 0x0f) if (hi > 0x0f)
p = pack_hex_byte(p, hi); p = hex_byte_pack(p, hi);
else else
*p++ = hex_asc_lo(hi); *p++ = hex_asc_lo(hi);
p = pack_hex_byte(p, lo); p = hex_byte_pack(p, lo);
} }
else if (lo > 0x0f) else if (lo > 0x0f)
p = pack_hex_byte(p, lo); p = hex_byte_pack(p, lo);
else else
*p++ = hex_asc_lo(lo); *p++ = hex_asc_lo(lo);
needcolon = true; needcolon = true;
...@@ -695,8 +695,8 @@ char *ip6_string(char *p, const char *addr, const char *fmt) ...@@ -695,8 +695,8 @@ char *ip6_string(char *p, const char *addr, const char *fmt)
int i; int i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
p = pack_hex_byte(p, *addr++); p = hex_byte_pack(p, *addr++);
p = pack_hex_byte(p, *addr++); p = hex_byte_pack(p, *addr++);
if (fmt[0] == 'I' && i != 7) if (fmt[0] == 'I' && i != 7)
*p++ = ':'; *p++ = ':';
} }
...@@ -754,7 +754,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr, ...@@ -754,7 +754,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
} }
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
p = pack_hex_byte(p, addr[index[i]]); p = hex_byte_pack(p, addr[index[i]]);
switch (i) { switch (i) {
case 3: case 3:
case 5: case 5:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册