Skip to content

Commit a73fa36

Browse files
geertubroonie
authored andcommitted
spi: loopback-test: Do not split 1024-byte hexdumps
spi_test_print_hex_dump() prints buffers holding less than 1024 bytes in full. Larger buffers are truncated: only the first 512 and the last 512 bytes are printed, separated by a truncation message. The latter is confusing in case the buffer holds exactly 1024 bytes, as all data is printed anyway. Fix this by printing buffers holding up to and including 1024 bytes in full. Fixes: 84e0c4e ("spi: add loopback test driver to allow for spi_master regression tests") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/37ee1bc90c6554c9347040adabf04188c8f704aa.1746184171.git.geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 92a09c4 commit a73fa36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-loopback-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ MODULE_LICENSE("GPL");
420420
static void spi_test_print_hex_dump(char *pre, const void *ptr, size_t len)
421421
{
422422
/* limit the hex_dump */
423-
if (len < 1024) {
423+
if (len <= 1024) {
424424
print_hex_dump(KERN_INFO, pre,
425425
DUMP_PREFIX_OFFSET, 16, 1,
426426
ptr, len, 0);

0 commit comments

Comments
 (0)