* [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop
@ 2024-01-21 20:01 Hoorad Farrokh
2024-01-22 7:37 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Hoorad Farrokh @ 2024-01-21 20:01 UTC (permalink / raw)
To: gregkh, linux-staging, linux-kernel
Fixed a linux coding style.
Reported by checkpath:
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: Hoorad Farrokh <hourrad.f@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index 1593980d2c6a..0145c4da5ac0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -127,9 +127,8 @@ void kfree_all_stainfo(struct sta_priv *pstapriv)
phead = get_list_head(&pstapriv->free_sta_queue);
plist = get_next(phead);
- while (phead != plist) {
+ while (phead != plist)
plist = get_next(plist);
- }
spin_unlock_bh(&pstapriv->sta_hash_lock);
}
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop
2024-01-21 20:01 [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop Hoorad Farrokh
@ 2024-01-22 7:37 ` Dan Carpenter
2024-01-22 23:28 ` Hoorad Farrokh
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2024-01-22 7:37 UTC (permalink / raw)
To: Hoorad Farrokh; +Cc: gregkh, linux-staging, linux-kernel
On Mon, Jan 22, 2024 at 09:01:27AM +1300, Hoorad Farrokh wrote:
> Fixed a linux coding style.
>
> Reported by checkpath:
>
> WARNING: braces {} are not necessary for single statement blocks
>
> Signed-off-by: Hoorad Farrokh <hourrad.f@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> index 1593980d2c6a..0145c4da5ac0 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> @@ -127,9 +127,8 @@ void kfree_all_stainfo(struct sta_priv *pstapriv)
> phead = get_list_head(&pstapriv->free_sta_queue);
> plist = get_next(phead);
>
> - while (phead != plist) {
> + while (phead != plist)
> plist = get_next(plist);
> - }
This function doesn't do anything... The name says "free_all" but it
doesn't free anything. I would prefer to fix this warning by adding
a comment:
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index 1593980d2c6a..4f856d126517 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -129,6 +129,7 @@ void kfree_all_stainfo(struct sta_priv *pstapriv)
while (phead != plist) {
plist = get_next(plist);
+ /* FIXME: free something? */
}
spin_unlock_bh(&pstapriv->sta_hash_lock);
We can also try adding that to the KTODO list.
KTODO: why does kfree_all_stainfo() not free anything.
Perhaps there is code in the other rtl drivers which shows how this
should be done?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Re: [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop
2024-01-22 7:37 ` Dan Carpenter
@ 2024-01-22 23:28 ` Hoorad Farrokh
2024-01-23 6:10 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Hoorad Farrokh @ 2024-01-22 23:28 UTC (permalink / raw)
To: Dan Carpenter; +Cc: gregkh, linux-staging, linux-kernel
Hello,
Thanks for your comment.
>
> This function doesn't do anything... The name says "free_all" but it
> doesn't free anything. I would prefer to fix this warning by adding
> a comment:
>
I didn't fully understand this part of your comment. Do you mean I should add a comment
to the while loop + my changes and submit it agian? or
do you mean I should find a way to free things in the while loop? then submit again?
Great regards,
Hoorad.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop
2024-01-22 23:28 ` Hoorad Farrokh
@ 2024-01-23 6:10 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2024-01-23 6:10 UTC (permalink / raw)
To: Hoorad Farrokh; +Cc: gregkh, linux-staging, linux-kernel
On Tue, Jan 23, 2024 at 12:28:44PM +1300, Hoorad Farrokh wrote:
> Hello,
> Thanks for your comment.
>
> >
> > This function doesn't do anything... The name says "free_all" but it
> > doesn't free anything. I would prefer to fix this warning by adding
> > a comment:
> >
>
> I didn't fully understand this part of your comment. Do you mean I should add a comment
> to the while loop + my changes and submit it agian? or
> do you mean I should find a way to free things in the while loop? then submit again?
>
Either one.
It's weird to note down the bugs in the source, but if we don't know how
to fix it, then perhaps that's the best we can do...
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-23 6:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-21 20:01 [PATCH] staging: rtl8723bs: remove unnecessary braces in while loop Hoorad Farrokh
2024-01-22 7:37 ` Dan Carpenter
2024-01-22 23:28 ` Hoorad Farrokh
2024-01-23 6:10 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®