13 Feb, 2015

2 commits

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Test different scenarios of function calls located in lib/hexdump.c.

    Currently hex_dump_to_buffer() is only tested and test data is provided
    for little endian CPUs.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko