Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272220
b: refs/heads/master
c: 55036ba
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and Linus Torvalds committed Nov 1, 2011
1 parent ecce833 commit e32f306
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66f6958e69d8055277356d3cc2e7a1d734db1755
refs/heads/master: 55036ba76b2d2fd53b5c00993fcec5ed56e83922
7 changes: 6 additions & 1 deletion trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,18 @@ extern const char hex_asc[];
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
#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_lo(byte);
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 __must_check hex2bin(u8 *dst, const char *src, size_t count);

Expand Down
14 changes: 7 additions & 7 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr,
}

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)
*p++ = separator;
}
Expand Down Expand Up @@ -667,13 +667,13 @@ char *ip6_compressed_string(char *p, const char *addr)
lo = word & 0xff;
if (hi) {
if (hi > 0x0f)
p = pack_hex_byte(p, hi);
p = hex_byte_pack(p, hi);
else
*p++ = hex_asc_lo(hi);
p = pack_hex_byte(p, lo);
p = hex_byte_pack(p, lo);
}
else if (lo > 0x0f)
p = pack_hex_byte(p, lo);
p = hex_byte_pack(p, lo);
else
*p++ = hex_asc_lo(lo);
needcolon = true;
Expand All @@ -695,8 +695,8 @@ char *ip6_string(char *p, const char *addr, const char *fmt)
int i;

for (i = 0; i < 8; i++) {
p = pack_hex_byte(p, *addr++);
p = pack_hex_byte(p, *addr++);
p = hex_byte_pack(p, *addr++);
p = hex_byte_pack(p, *addr++);
if (fmt[0] == 'I' && i != 7)
*p++ = ':';
}
Expand Down Expand Up @@ -754,7 +754,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
}

for (i = 0; i < 16; i++) {
p = pack_hex_byte(p, addr[index[i]]);
p = hex_byte_pack(p, addr[index[i]]);
switch (i) {
case 3:
case 5:
Expand Down

0 comments on commit e32f306

Please sign in to comment.