summaryrefslogtreecommitdiffstats
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-02-12 18:02:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-12 21:54:15 -0500
commit114fc1afb2de7dec40da137dc2a55cd38fc220f2 (patch)
tree414c7731a5a4743cbdba6583a1b79f3723ec190d /include/linux/printk.h
parent5d909c8d54b114eddb7c50506f03bf7309a9192e (diff)
hexdump: make it return number of bytes placed in buffer
This patch makes hexdump return the number of bytes placed in the buffer excluding trailing NUL. In the case of overflow it returns the desired amount of bytes to produce the entire dump. Thus, it mimics snprintf(). This will be useful for users that would like to repeat with a bigger buffer. [akpm@linux-foundation.org: fix printk warning] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r--include/linux/printk.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 4d5bf5726578..baa3f97d8ce8 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -417,9 +417,9 @@ enum {
417 DUMP_PREFIX_ADDRESS, 417 DUMP_PREFIX_ADDRESS,
418 DUMP_PREFIX_OFFSET 418 DUMP_PREFIX_OFFSET
419}; 419};
420extern void hex_dump_to_buffer(const void *buf, size_t len, 420extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
421 int rowsize, int groupsize, 421 int groupsize, char *linebuf, size_t linebuflen,
422 char *linebuf, size_t linebuflen, bool ascii); 422 bool ascii);
423#ifdef CONFIG_PRINTK 423#ifdef CONFIG_PRINTK
424extern void print_hex_dump(const char *level, const char *prefix_str, 424extern void print_hex_dump(const char *level, const char *prefix_str,
425 int prefix_type, int rowsize, int groupsize, 425 int prefix_type, int rowsize, int groupsize,