diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 78d56614c95b..36cbb873845f 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -336,14 +336,12 @@ trace_seq_putmem(struct trace_seq *s, void *mem, size_t len) | |||
336 | } | 336 | } |
337 | 337 | ||
338 | #define HEX_CHARS 17 | 338 | #define HEX_CHARS 17 |
339 | static const char hex2asc[] = "0123456789abcdef"; | ||
340 | 339 | ||
341 | static int | 340 | static int |
342 | trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | 341 | trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) |
343 | { | 342 | { |
344 | unsigned char hex[HEX_CHARS]; | 343 | unsigned char hex[HEX_CHARS]; |
345 | unsigned char *data = mem; | 344 | unsigned char *data = mem; |
346 | unsigned char byte; | ||
347 | int i, j; | 345 | int i, j; |
348 | 346 | ||
349 | BUG_ON(len >= HEX_CHARS); | 347 | BUG_ON(len >= HEX_CHARS); |
@@ -353,10 +351,8 @@ trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | |||
353 | #else | 351 | #else |
354 | for (i = len-1, j = 0; i >= 0; i--) { | 352 | for (i = len-1, j = 0; i >= 0; i--) { |
355 | #endif | 353 | #endif |
356 | byte = data[i]; | 354 | hex[j++] = hex_asc_hi(data[i]); |
357 | 355 | hex[j++] = hex_asc_lo(data[i]); | |
358 | hex[j++] = hex2asc[byte & 0x0f]; | ||
359 | hex[j++] = hex2asc[byte >> 4]; | ||
360 | } | 356 | } |
361 | hex[j++] = ' '; | 357 | hex[j++] = ' '; |
362 | 358 | ||