Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: loopback-test: don't skip comparing the first byte of rx_buf

When the loopback parameter is set, rx_buf are compared with tx_buf
after the spi_message is executed. But the first byte of buffer is
not checked.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Akinobu Mita and committed by
Mark Brown
8494801d c4e121ae

+1 -1
+1 -1
drivers/spi/spi-loopback-test.c
··· 507 507 continue; 508 508 /* so depending on tx_buf we need to handle things */ 509 509 if (xfer->tx_buf) { 510 - for (i = 1; i < xfer->len; i++) { 510 + for (i = 0; i < xfer->len; i++) { 511 511 txb = ((u8 *)xfer->tx_buf)[i]; 512 512 rxb = ((u8 *)xfer->rx_buf)[i]; 513 513 if (txb != rxb)