* [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
@ 2026-07-17 14:03 Hussien Sajjad Ali
2026-07-17 14:33 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Hussien Sajjad Ali @ 2026-07-17 14:03 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, Hussien Sajjad Ali
The checkpatch.pl tool reports a warning for using an unnecessary else
after a return statement. This patch refactors the while loop logic in
enqueue_reorder_recvframe to remove the unnecessary else block and
improve code style.
Signed-off-by: Hussien Sajjad Ali <teamakeads@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 16ec2248b083..915559f64b40 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1763,7 +1763,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
return true;
}
-
static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
{
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
@@ -1782,16 +1781,17 @@ 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))
- /* 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)) {
+ 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;
+ }
break;
- }
+ }
+ plist = get_next(plist);
+ }
/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
/* spin_lock(&ppending_recvframe_queue->lock); */
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
@ 2026-07-12 19:18 Hussien Sajjad Ali
2026-07-17 12:14 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Hussien Sajjad Ali @ 2026-07-12 19:18 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, straube.linux, hansg, Hussien Sajjad Ali
Signed-off-by: Hussien Sajjad Ali <teamakeads@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 16ec2248b083..915559f64b40 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1763,7 +1763,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
return true;
}
-
static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
{
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
@@ -1782,16 +1781,17 @@ 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))
- /* 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)) {
+ 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;
+ }
break;
- }
+ }
+ plist = get_next(plist);
+ }
/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
/* spin_lock(&ppending_recvframe_queue->lock); */
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
2026-07-12 19:18 Hussien Sajjad Ali
@ 2026-07-17 12:14 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2026-07-17 12:14 UTC (permalink / raw)
To: Hussien Sajjad Ali; +Cc: linux-staging, straube.linux, hansg
On Sun, Jul 12, 2026 at 10:18:58PM +0300, Hussien Sajjad Ali wrote:
> Signed-off-by: Hussien Sajjad Ali <teamakeads@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_recv.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index 16ec2248b083..915559f64b40 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -1763,7 +1763,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
>
> return true;
> }
> -
> static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
> {
> struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
> @@ -1782,16 +1781,17 @@ 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))
> - /* 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)) {
> + 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;
> + }
> break;
> - }
> + }
>
> + plist = get_next(plist);
> + }
> /* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
> /* spin_lock(&ppending_recvframe_queue->lock); */
>
> --
> 2.55.0
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/process/submitting-patches.rst for what is needed in
order to properly describe the change.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-17 14:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 14:03 [PATCH] staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe Hussien Sajjad Ali
2026-07-17 14:33 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2026-07-12 19:18 Hussien Sajjad Ali
2026-07-17 12:14 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox