* [PATCH] staging: rtl8723bs: remove redundant else after return [not found] <20260528-fix-else-after-return-v1-1-f07ea0f010fb.ref@yahoo.pl> @ 2026-05-28 9:55 ` Tomasz Unger 2026-05-28 10:24 ` Dan Carpenter 0 siblings, 1 reply; 2+ messages in thread From: Tomasz Unger @ 2026-05-28 9:55 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tomasz Unger 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> ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8723bs: remove redundant else after return 2026-05-28 9:55 ` [PATCH] staging: rtl8723bs: remove redundant else after return Tomasz Unger @ 2026-05-28 10:24 ` Dan Carpenter 0 siblings, 0 replies; 2+ messages in thread From: Dan Carpenter @ 2026-05-28 10:24 UTC (permalink / raw) To: Tomasz Unger; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-28 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260528-fix-else-after-return-v1-1-f07ea0f010fb.ref@yahoo.pl>
2026-05-28 9:55 ` [PATCH] staging: rtl8723bs: remove redundant else after return Tomasz Unger
2026-05-28 10:24 ` Dan Carpenter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox