* [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
* Re: [PATCH] staging: rtl8723bs: remove unnecessary else after break/return
2026-07-21 16:02 [PATCH] staging: rtl8723bs: remove unnecessary else after break/return ColtenOuO
@ 2026-07-23 8:29 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-07-23 8:29 UTC (permalink / raw)
To: ColtenOuO
Cc: Greg Kroah-Hartman, 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
On Tue, Jul 21, 2026 at 04:02:32PM +0000, ColtenOuO wrote:
> 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>
That's not the name you use to sign legal documents.
But really, the original code is fine, just ignore tools when they are
wrong.
regards,
dan carpenter
^ permalink raw reply [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