mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpib: lpvo_usb: rewrite DLE/STX sequence validation using !(A && B) for clarity
@ 2026-05-16  3:12 sunliming
  0 siblings, 0 replies; 2+ messages in thread
From: sunliming @ 2026-05-16  3:12 UTC (permalink / raw)
  To: dpenkler, gregkh
  Cc: johan, harshit.m.mogalapalli, kees, linux-kernel, sunliming

From: sunliming <sunliming@kylinos.cn>

Fix below smatch warnings:
drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c:808 usb_gpib_read() warn: was
&& intended here instead of ||?

Signed-off-by: sunliming <sunliming@kylinos.cn>
---
 drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
index e6ea9422d6f2..3e09f8226a56 100644
--- a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
+++ b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
@@ -802,7 +802,7 @@ static int usb_gpib_read(struct gpib_board *board,
 	if (retval < 0)
 		goto read_return;
 
-	if (one_char(board, &b) != DLE || one_char(board, &b) != STX) {
+	if (!(one_char(board, &b) == DLE && one_char(board, &b) == STX)) {
 		dev_err(board->gpib_dev, "wrong <DLE><STX> sequence\n");
 		retval = -EIO;
 		goto read_return;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-18 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6a07e0f7.e59d1661.1cd5fe.6c90SMTPIN_ADDED_BROKEN@mx.google.com>
2026-05-18 10:56 ` [PATCH] gpib: lpvo_usb: rewrite DLE/STX sequence validation using !(A && B) for clarity Johan Hovold
2026-05-16  3:12 sunliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®