aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-01-12 19:59:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:10 -0500
commitac83ed687837a44c6e46fb16411fb0d299fffd80 (patch)
tree04abc4db3153056b2c478209bfb8a4c7701d6a5b
parent16cb839f13324978bd58082e69de81a711802b11 (diff)
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: Joe Perches <joe@perches.com> Cc: Matt Mackall <mpm@selenic.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/printk.h42
-rw-r--r--lib/hexdump.c2
2 files changed, 30 insertions, 14 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 6442156707c9..e96bd41491bd 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -141,20 +141,6 @@ static inline void log_buf_kexec_setup(void)
141 141
142extern void dump_stack(void) __cold; 142extern void dump_stack(void) __cold;
143 143
144enum {
145 DUMP_PREFIX_NONE,
146 DUMP_PREFIX_ADDRESS,
147 DUMP_PREFIX_OFFSET
148};
149extern void hex_dump_to_buffer(const void *buf, size_t len,
150 int rowsize, int groupsize,
151 char *linebuf, size_t linebuflen, bool ascii);
152extern void print_hex_dump(const char *level, const char *prefix_str,
153 int prefix_type, int rowsize, int groupsize,
154 const void *buf, size_t len, bool ascii);
155extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
156 const void *buf, size_t len);
157
158#ifndef pr_fmt 144#ifndef pr_fmt
159#define pr_fmt(fmt) fmt 145#define pr_fmt(fmt) fmt
160#endif 146#endif
@@ -286,4 +272,32 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
286 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 272 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
287#endif 273#endif
288 274
275
276enum {
277 DUMP_PREFIX_NONE,
278 DUMP_PREFIX_ADDRESS,
279 DUMP_PREFIX_OFFSET
280};
281extern void hex_dump_to_buffer(const void *buf, size_t len,
282 int rowsize, int groupsize,
283 char *linebuf, size_t linebuflen, bool ascii);
284#ifdef CONFIG_PRINTK
285extern void print_hex_dump(const char *level, const char *prefix_str,
286 int prefix_type, int rowsize, int groupsize,
287 const void *buf, size_t len, bool ascii);
288extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
289 const void *buf, size_t len);
290#else
291static inline void print_hex_dump(const char *level, const char *prefix_str,
292 int prefix_type, int rowsize, int groupsize,
293 const void *buf, size_t len, bool ascii)
294{
295}
296static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
297 const void *buf, size_t len)
298{
299}
300
301#endif
302
289#endif 303#endif
diff --git a/lib/hexdump.c b/lib/hexdump.c
index b66b2bd67952..f5fe6ba7a3ab 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -154,6 +154,7 @@ nil:
154} 154}
155EXPORT_SYMBOL(hex_dump_to_buffer); 155EXPORT_SYMBOL(hex_dump_to_buffer);
156 156
157#ifdef CONFIG_PRINTK
157/** 158/**
158 * print_hex_dump - print a text hex dump to syslog for a binary blob of data 159 * print_hex_dump - print a text hex dump to syslog for a binary blob of data
159 * @level: kernel log level (e.g. KERN_DEBUG) 160 * @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 buf, len, true); 239 buf, len, true);
239} 240}
240EXPORT_SYMBOL(print_hex_dump_bytes); 241EXPORT_SYMBOL(print_hex_dump_bytes);
242#endif