drivers/staging/rtl8723bs/core/rtw_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
In enqueue_reorder_recvframe(), the else branch after a return
statement is unnecessary. When a duplicate sequence number is found,
the function returns false immediately, making the else keyword
redundant. Remove else and fix the indentation of the break statement.
Reported by checkpatch.pl with no remaining warnings.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 86c5e2c4e7dd..51536f155750 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1789,8 +1789,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
/* 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); */
---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260528-fix-else-after-return-1225fa7dec5f
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
On Thu, May 28, 2026 at 11:55:42AM +0200, Tomasz Unger wrote: > In enqueue_reorder_recvframe(), the else branch after a return > statement is unnecessary. When a duplicate sequence number is found, > the function returns false immediately, making the else keyword > redundant. Remove else and fix the indentation of the break statement. > > Reported by checkpatch.pl with no remaining warnings. > > Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> > --- > drivers/staging/rtl8723bs/core/rtw_recv.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c > index 86c5e2c4e7dd..51536f155750 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_recv.c > +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c > @@ -1789,8 +1789,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un > /* Duplicate entry is found!! Do not insert current entry. */ > /* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */ > return false; > - else > - break; > + break; You have made the code buggy. Don't follow checkpatch blindly. regards, dan carpenter
© 2016 - 2026 Red Hat, Inc.