Re: [PATCH] staging: rtl8723bs: remove redundant else after return
From: Dan Carpenter
Date: Thu May 28 2026 - 06:33:57 EST
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@xxxxxxxx>
> ---
> 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