08 Dec, 2018

1 commit

  • commit b1286ed7158e9b62787508066283ab0b8850b518 upstream.

    New versions of gcc reasonably warn about the odd pattern of

    strncpy(p, q, strlen(q));

    which really doesn't make sense: the strncpy() ends up being just a slow
    and odd way to write memcpy() in this case.

    Apparently there was a patch for this floating around earlier, but it
    got lost.

    Acked-again-by: Andy Shevchenko
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Linus Torvalds
     

21 Jan, 2016

9 commits

  • Like others test are doing print the gathered statistics after test module
    is finished. Return from the module based on the result.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Currently the only one combination is tested for overflow, i.e. rowsize =
    16, groupsize = 1, len = 1. Do various test to go through all possible
    branches.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • After processing by hex_dump_to_buffer() check all the parts to be expected.

    Part 1. The actual expected hex dump with or without ASCII part.

    Part 2. Check if the buffer is dirty beyond needed.

    Part 3. Return code should be as expected.

    This is done by using comparison of the return code and memcmp() against
    the test buffer. We fill the buffer by FILL_CHAR ('#') characters, so, we
    expect to have a tail of the buffer will be left untouched. The
    terminating NUL is also checked by memcmp().

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Better to use memcmp() against entire buffer to check that nothing is
    happened to the data in the tail.

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

    Andy Shevchenko
     
  • The magic numbers of the length are converted to their actual meaning,
    such as end of the buffer with and without ASCII part.

    We don't touch the rest of the magic constants that will be removed in the
    following commits.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • When test for overflow do iterate the buffer length in a range 0 ..
    BUF_SIZE.

    Signed-off-by: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Define a character to fill the test buffers. Though the character should
    be printable since it's used when errors are reported. It should neither
    be from hex digit [a-fA-F0-9] dictionary nor space. It is recommended not
    to use one which is present in ASCII part of the test data. Later on we
    might switch to unprintable character to make test case more robust.

    Signed-off-by: Andy Shevchenko
    Suggested-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The function prepares the expected result in the provided buffer.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • The test suite currently doesn't cover many corner cases when
    hex_dump_to_buffer() runs into overflow. Refactor and amend test suite
    to cover most of the cases.

    This patch (of 9):

    Just to follow the scheme that most of the test modules are using.

    There is no fuctional change.

    Signed-off-by: Andy Shevchenko
    Acked-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko