From: Dan Carpenter <error27@gmail.com>
To: Tomasz Unger <tomasz.unger@yahoo.pl>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: remove redundant else after return
Date: Thu, 28 May 2026 13:24:52 +0300 [thread overview]
Message-ID: <ahgX9AUuNqpzwbDV@stanley.mountain> (raw)
In-Reply-To: <20260528-fix-else-after-return-v1-1-f07ea0f010fb@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
prev parent reply other threads:[~2026-05-28 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 message]
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=ahgX9AUuNqpzwbDV@stanley.mountain \
--to=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=tomasz.unger@yahoo.pl \
/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