The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe
@ 2026-07-09  4:03 Aditya Tipre
  2026-07-09 11:22 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Tipre @ 2026-07-09  4:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Aditya Tipre

The duplicate-frame path returns immediately, so the following else is
unnecessary. Use continue while walking the reorder queue and fall through
to break once the insertion point is found.

Signed-off-by: Aditya Tipre <tipreaditya@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 86c5e2c4e7dd..c97c5fb73bb7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1783,14 +1783,17 @@ 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))
+		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) {
 			plist = get_next(plist);
-		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
+			continue;
+		}
+
+		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
-			break;
+
+		break;
 	}
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
-- 
2.54.0


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

* Re: [PATCH] staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe
  2026-07-09  4:03 [PATCH] staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe Aditya Tipre
@ 2026-07-09 11:22 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-07-09 11:22 UTC (permalink / raw)
  To: Aditya Tipre; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Thu, Jul 09, 2026 at 12:03:48AM -0400, Aditya Tipre wrote:
> The duplicate-frame path returns immediately, so the following else is
> unnecessary.

What?  Also no.  It's necessary.  Checkpatch is just a simple perl script.
Use this as an opportunity to learn to be critical of your tools.  ;)

regards,
dan carpenter


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

end of thread, other threads:[~2026-07-09 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09  4:03 [PATCH] staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe Aditya Tipre
2026-07-09 11:22 ` Dan Carpenter

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