Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: remove unnecessary else after break/return
@ 2026-07-21 16:02 ColtenOuO
  2026-07-23  8:29 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: ColtenOuO @ 2026-07-21 16:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: ColtenOuO, Hans de Goede, Michael Straube, Nikolay Kulikov,
	Andrei Khomenkov, Jennifer Guo, Minu Jin, Khasar Munkh-Erdene,
	Mohammed Rizwan Kaniyate, open list:STAGING SUBSYSTEM, open list

checkpatch.pl flags an else clause following a branch that already
returns, in enqueue_reorder_recvframe(). Restructure the if/else-if/else
chain into sequential checks to remove the redundant else, with no
change in behavior.

Signed-off-by: ColtenOuO <jun930436@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 86c5e2c4e7dd..79bd56a5d6cd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1783,14 +1783,12 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
 		pnextrframe = (union recv_frame *)plist;
 		pnextattrib = &pnextrframe->u.hdr.attrib;
 
-		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
-			plist = get_next(plist);
-		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
+		if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
 			/* Duplicate entry is found!! Do not insert current entry. */
-			/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
 			return false;
-		else
+		if (!SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
 			break;
+		plist = get_next(plist);
 	}
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
-- 
2.43.0


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

end of thread, other threads:[~2026-07-23 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 16:02 [PATCH] staging: rtl8723bs: remove unnecessary else after break/return ColtenOuO
2026-07-23  8:29 ` Dan Carpenter

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