projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2dbe74c
)
spi: loopback-test: Simplify strange loopback value check
author
Geert Uytterhoeven
<geert+renesas@glider.be>
Fri, 2 May 2025 11:12:39 +0000
(13:12 +0200)
committer
Mark Brown
<broonie@kernel.org>
Fri, 2 May 2025 23:16:51 +0000
(08:16 +0900)
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>
drivers/spi/spi-loopback-test.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/spi/spi-loopback-test.c
b/drivers/spi/spi-loopback-test.c
index 31a878d9458d95fd175342121762c6c9be224616..369cdb707fada77ee8205eedabdddb1e334cbeb0 100644
(file)
--- a/
drivers/spi/spi-loopback-test.c
+++ b/
drivers/spi/spi-loopback-test.c
@@
-635,8
+635,8
@@
static int spi_test_check_loopback_result(struct spi_device *spi,
} else {
/* first byte received */
txb = ((u8 *)xfer->rx_buf)[0];
- /* first byte may be 0 or xff */
- if (
!((txb == 0) || (txb == 0xff))
) {
+ /* first byte may be 0 or
0
xff */
+ if (
txb != 0 && txb != 0xff
) {
dev_err(&spi->dev,
"loopback strangeness - we expect 0x00 or 0xff, but not 0x%02x\n",
txb);