Linux kernel staging patches
 help / color / mirror / Atom feed
From: Hussien Sajjad Ali <teamakeads@gmail.com>
To: linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, Hussien Sajjad Ali <teamakeads@gmail.com>
Subject: [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
Date: Fri, 17 Jul 2026 17:03:44 +0300	[thread overview]
Message-ID: <20260717140344.16131-1-teamakeads@gmail.com> (raw)

The checkpatch.pl tool reports a warning for using an unnecessary else
after a return statement. This patch refactors the while loop logic in
enqueue_reorder_recvframe to remove the unnecessary else block and
improve code style.

Signed-off-by: Hussien Sajjad Ali <teamakeads@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 16ec2248b083..915559f64b40 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1763,7 +1763,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
 
 	return true;
 }
-
 static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
 {
 	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
@@ -1782,16 +1781,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))
-			plist = get_next(plist);
-		else 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)) {
+			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;
+			}
 			break;
-	}
+		}
 
+		plist = get_next(plist);
+	}
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
 	/* spin_lock(&ppending_recvframe_queue->lock); */
 
-- 
2.55.0


             reply	other threads:[~2026-07-17 14:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 14:03 Hussien Sajjad Ali [this message]
2026-07-17 14:33 ` [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2026-07-12 19:18 Hussien Sajjad Ali
2026-07-17 12:14 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260717140344.16131-1-teamakeads@gmail.com \
    --to=teamakeads@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox