mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
5d909c8d54
commit
114fc1afb2
3 changed files with 103 additions and 21 deletions
|
@ -417,9 +417,9 @@ enum {
|
|||
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 int 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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue