Skip to content

Commit 233d740

Browse files
geertubroonie
authored andcommitted
spi: loopback-test: Simplify strange loopback value check
Apply De Morgan's Theorem and drop superfluous parentheses to simplify the check for strange loopback values. While at it, add the missing zero in the related comment. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/da612090f543c8c7cc99fb9dc6ef4abc9560abe4.1746184293.git.geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2dbe74c commit 233d740

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/spi/spi-loopback-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ static int spi_test_check_loopback_result(struct spi_device *spi,
635635
} else {
636636
/* first byte received */
637637
txb = ((u8 *)xfer->rx_buf)[0];
638-
/* first byte may be 0 or xff */
639-
if (!((txb == 0) || (txb == 0xff))) {
638+
/* first byte may be 0 or 0xff */
639+
if (txb != 0 && txb != 0xff) {
640640
dev_err(&spi->dev,
641641
"loopback strangeness - we expect 0x00 or 0xff, but not 0x%02x\n",
642642
txb);

0 commit comments

Comments
 (0)