* [PATCH] staging: rtl8723bs: remove useless comparison in _rtw_reg_apply_flags()
@ 2022-07-19 15:53 Andrey Strachuk
2022-07-27 6:41 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Strachuk @ 2022-07-19 15:53 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Andrey Strachuk, Hans de Goede, linux-staging, linux-kernel, ldv-project
Local variable 'ch' is initialized by an address
of field of ieee80211_supported_band structure, so it does
not make sense to compare 'ch' with NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
---
drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
index 5eef1d68c6f0..62fbf9e1b849 100644
--- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
+++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
@@ -74,8 +74,7 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
for (j = 0; j < sband->n_channels; j++) {
ch = &sband->channels[j];
- if (ch)
- ch->flags = IEEE80211_CHAN_DISABLED;
+ ch->flags = IEEE80211_CHAN_DISABLED;
}
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8723bs: remove useless comparison in _rtw_reg_apply_flags()
2022-07-19 15:53 [PATCH] staging: rtl8723bs: remove useless comparison in _rtw_reg_apply_flags() Andrey Strachuk
@ 2022-07-27 6:41 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2022-07-27 6:41 UTC (permalink / raw)
To: Andrey Strachuk; +Cc: Hans de Goede, linux-staging, linux-kernel, ldv-project
On Tue, Jul 19, 2022 at 06:53:09PM +0300, Andrey Strachuk wrote:
> Local variable 'ch' is initialized by an address
> of field of ieee80211_supported_band structure, so it does
> not make sense to compare 'ch' with NULL.
Where is it initialized with an address? You need to document this
here.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
This is not a bug fix, but a code optimization, so no need for this
Fixes: tag.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-27 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 15:53 [PATCH] staging: rtl8723bs: remove useless comparison in _rtw_reg_apply_flags() Andrey Strachuk
2022-07-27 6:41 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.