Commit ac83ed68 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

include/linux/printk.h lib/hexdump.c: neatening and add CONFIG_PRINTK guard

- Move prototypes and align arguments.

- Add CONFIG_PRINTK guard for print_hex functions
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 16cb839f
...@@ -141,20 +141,6 @@ static inline void log_buf_kexec_setup(void) ...@@ -141,20 +141,6 @@ static inline void log_buf_kexec_setup(void)
extern void dump_stack(void) __cold; extern void dump_stack(void) __cold;
enum {
DUMP_PREFIX_NONE,
DUMP_PREFIX_ADDRESS,
DUMP_PREFIX_OFFSET
};
extern void hex_dump_to_buffer(const void *buf, size_t len,
int rowsize, int groupsize,
char *linebuf, size_t linebuflen, bool ascii);
extern void print_hex_dump(const char *level, const char *prefix_str,
int prefix_type, int rowsize, int groupsize,
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);
#ifndef pr_fmt #ifndef pr_fmt
#define pr_fmt(fmt) fmt #define pr_fmt(fmt) fmt
#endif #endif
...@@ -286,4 +272,32 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, ...@@ -286,4 +272,32 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#endif #endif
enum {
DUMP_PREFIX_NONE,
DUMP_PREFIX_ADDRESS,
DUMP_PREFIX_OFFSET
};
extern void hex_dump_to_buffer(const void *buf, size_t len,
int rowsize, int groupsize,
char *linebuf, size_t linebuflen, bool ascii);
#ifdef CONFIG_PRINTK
extern void print_hex_dump(const char *level, const char *prefix_str,
int prefix_type, int rowsize, int groupsize,
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);
#else
static inline void print_hex_dump(const char *level, const char *prefix_str,
int prefix_type, int rowsize, int groupsize,
const void *buf, size_t len, bool ascii)
{
}
static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
const void *buf, size_t len)
{
}
#endif
#endif #endif
...@@ -154,6 +154,7 @@ void hex_dump_to_buffer(const void *buf, size_t len, int rowsize, ...@@ -154,6 +154,7 @@ void hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
} }
EXPORT_SYMBOL(hex_dump_to_buffer); EXPORT_SYMBOL(hex_dump_to_buffer);
#ifdef CONFIG_PRINTK
/** /**
* print_hex_dump - print a text hex dump to syslog for a binary blob of data * print_hex_dump - print a text hex dump to syslog for a binary blob of data
* @level: kernel log level (e.g. KERN_DEBUG) * @level: kernel log level (e.g. KERN_DEBUG)
...@@ -238,3 +239,4 @@ void print_hex_dump_bytes(const char *prefix_str, int prefix_type, ...@@ -238,3 +239,4 @@ void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
buf, len, true); buf, len, true);
} }
EXPORT_SYMBOL(print_hex_dump_bytes); EXPORT_SYMBOL(print_hex_dump_bytes);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment