Skip to content

Commit

Permalink
spi: loopback-test: don't skip comparing the first byte of rx_buf
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
mita authored and broonie committed Mar 17, 2017
1 parent c4e121a commit 8494801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-loopback-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ static int spi_test_check_loopback_result(struct spi_device *spi,
continue;
/* so depending on tx_buf we need to handle things */
if (xfer->tx_buf) {
for (i = 1; i < xfer->len; i++) {
for (i = 0; i < xfer->len; i++) {
txb = ((u8 *)xfer->tx_buf)[i];
rxb = ((u8 *)xfer->rx_buf)[i];
if (txb != rxb)
Expand Down

0 comments on commit 8494801

Please sign in to comment.