mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriel Windlin <gawindlin@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nikolay Kulikov <nikolayof23@gmail.com>,
	Andrei Khomenkov <khomenkov@mailbox.org>,
	Khasar Munkh-Erdene <02khasar@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: Gabriel Windlin <gawindlin@gmail.com>
Subject: [PATCH] staging: rtl8723bs: remove unneeded else after return in enqueue_reorder_recvframe()
Date: Mon,  7 Sep 2026 01:35:43 +0200	[thread overview]
Message-ID: <20260906233552.971860-1-gawindlin@gmail.com> (raw)

In enqueue_reorder_recvframe(), checkpatch warns that 'else is not
generally useful after a break or return'. The duplicate packet check
returns false, making the following else on break redundant.

Simplify the loop control flow by using continue when advancing the
list and eliminating the unneeded else statement.

Signed-off-by: Gabriel Windlin <gawindlin@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 7568fc514d7c..498c7273f273 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1782,14 +1782,15 @@ 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))
-			/* Duplicate entry is found!! Do not insert current entry. */
-			/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
+			continue;
+		}
+
+		if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
 			return false;
-		else
-			break;
+
+		break;
 	}
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */

base-commit: df2908090cda368b01ff43709f51890076c56157
prerequisite-patch-id: c05d9c90e8d4b20dfed666f3512e0d5bc54e2f2c
-- 
2.55.0


             reply	other threads:[~2026-09-06 23:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06 23:35 Gabriel Windlin [this message]
2026-09-07  7:31 ` Nikolay Kulikov

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=20260906233552.971860-1-gawindlin@gmail.com \
    --to=gawindlin@gmail.com \
    --cc=02khasar@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khomenkov@mailbox.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nikolayof23@gmail.com \
    /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

all inboxes | Powered by JetHome®