diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2008-05-18 11:54:43 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-18 11:54:43 +0200 |
| commit | b4ef290d7c3abd1bf8cefcf8def359537fda7f31 (patch) | |
| tree | f3e270923fa36c773eee3bb1f9981aab1711d938 /include/linux/kernel.h | |
| parent | 77b52b4c5c66175553ee59eb43f74366f1e54bde (diff) | |
| parent | f26a3988917913b3d11b2bd741601a2c64ab9204 (diff) | |
Merge branch 'linus' into x86/pat
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d46e299afb5..792bf0aa779b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -276,7 +276,17 @@ extern void print_hex_dump(const char *level, const char *prefix_str, const void *buf, size_t len, bool ascii); extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, const void *buf, size_t len); -#define hex_asc(x) "0123456789abcdef"[x] + +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) +{ + *buf++ = hex_asc_hi(byte); + *buf++ = hex_asc_lo(byte); + return buf; +} #define pr_emerg(fmt, arg...) \ printk(KERN_EMERG fmt, ##arg) |
