diff options
author | Joe Perches <joe@perches.com> | 2014-01-14 02:31:27 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-01-14 14:53:50 -0500 |
commit | b8dbc3241fff043213e8be8e798d45eb6ed28b96 (patch) | |
tree | 904f83fb854645d374a7f2de6d63d9966b7b45b9 /kernel | |
parent | 06bdadd7634551cfe8ce071fe44d0311b3033d9e (diff) |
audit: Use hex_byte_pack_upper
Using the generic kernel function causes the
object size to increase with gcc 4.8.1.
$ size kernel/audit.o*
text data bss dec hex filename
18577 6079 8436 33092 8144 kernel/audit.o.new
18579 6015 8420 33014 80f6 kernel/audit.o.old
Unsigned...
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 9daf24361d53..b5e6fd81949a 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -1466,7 +1466,6 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, | |||
1466 | int i, avail, new_len; | 1466 | int i, avail, new_len; |
1467 | unsigned char *ptr; | 1467 | unsigned char *ptr; |
1468 | struct sk_buff *skb; | 1468 | struct sk_buff *skb; |
1469 | static const unsigned char *hex = "0123456789ABCDEF"; | ||
1470 | 1469 | ||
1471 | if (!ab) | 1470 | if (!ab) |
1472 | return; | 1471 | return; |
@@ -1484,10 +1483,8 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, | |||
1484 | } | 1483 | } |
1485 | 1484 | ||
1486 | ptr = skb_tail_pointer(skb); | 1485 | ptr = skb_tail_pointer(skb); |
1487 | for (i=0; i<len; i++) { | 1486 | for (i = 0; i < len; i++) |
1488 | *ptr++ = hex[(buf[i] & 0xF0)>>4]; /* Upper nibble */ | 1487 | ptr = hex_byte_pack_upper(ptr, buf[i]); |
1489 | *ptr++ = hex[buf[i] & 0x0F]; /* Lower nibble */ | ||
1490 | } | ||
1491 | *ptr = 0; | 1488 | *ptr = 0; |
1492 | skb_put(skb, len << 1); /* new string is twice the old string */ | 1489 | skb_put(skb, len << 1); /* new string is twice the old string */ |
1493 | } | 1490 | } |