1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/realtek/rtlwifi
Nathan Chancellor 533ccdae76 rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace()
Clang warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning:
variable 'place' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
        if (chnl > 14) {
            ^~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:909:9: note:
uninitialized use occurs here
        return place;
               ^~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:2: note: remove
the 'if' if its condition is always true
        if (chnl > 14) {
        ^~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:899:10: note:
initialize the variable 'place' to silence this warning
        u8 place;
                ^
                 = '\0'
1 warning generated.

Commit 369956ae57 ("rtlwifi: rtl8192de: Remove redundant variable
initializations") removed the initialization of place but it appears
that this removal was in the wrong function.

_rtl92c_phy_get_rightchnlplace() returns place's value at the end of the
function so now if the if statement is false, place never gets
initialized. Add that initialization back to address the warning.

place's initialization is not necessary in
rtl92d_get_rightchnlplace_for_iqk() as place is only used within the if
statement so it can be removed, which is likely what was intended in the
first place.

Fixes: 369956ae57 ("rtlwifi: rtl8192de: Remove redundant variable initializations")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210823222014.764557-1-nathan@kernel.org
2021-08-29 10:28:32 +03:00
..
btcoexist rtlwifi: btcoex: 21a 2ant: Delete several duplicate condition branch codes 2021-06-15 16:38:05 +03:00
rtl8188ee rtlwifi: rtl8188ee: remove redundant assignment of variable rtlpriv->btcoexist.reg_bt_sco 2021-04-17 20:30:01 +03:00
rtl8192c rtlwifi: rtl8192c-common: fix bool comparison in expressions 2021-01-25 16:21:05 +02:00
rtl8192ce rtlwifi: rtl8192ce: avoid accessing the data mapped to streaming DMA 2020-11-24 17:06:35 +02:00
rtl8192cu rtlwifi: Fix wrong function name in comments 2021-06-15 16:10:46 +03:00
rtl8192de rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() 2021-08-29 10:28:32 +03:00
rtl8192ee rtlwifi: rtl8192ee: use true,false for bool variable large_cfo_hit 2020-09-22 10:17:42 +03:00
rtl8192se rtlwifi: Fix spelling of 'download' 2021-06-15 16:40:54 +03:00
rtl8723ae rtlwifi: rtl8723ae: remove redundant initialization of variable rtstatus 2021-06-15 16:39:37 +03:00
rtl8723be rtlwifi: rtl8723be: Remove set but unused variable 'cck_highpwr' 2020-11-07 18:14:45 +02:00
rtl8723com rtlwifi: Use ffs in <foo>_phy_calculate_bit_shift 2020-09-22 10:16:41 +03:00
rtl8821ae rtlwifi: 8821ae: upgrade PHY and RF parameters 2021-04-17 20:26:39 +03:00
base.c net: rtlwifi: properly check for alloc_workqueue() failure 2021-05-13 17:30:26 +02:00
base.h net: rtlwifi: Remove void* casts related to delayed work 2020-09-29 14:02:55 -07:00
cam.c rtlwifi: Remove redundant assignments to ul_enc_algo 2021-06-15 16:39:55 +03:00
cam.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
core.c rtlwifi: implement set_tim by update beacon content 2021-04-21 12:39:33 +03:00
core.h rtlwifi: implement set_tim by update beacon content 2021-04-21 12:39:33 +03:00
debug.c net: rtlwifi: Remove in_interrupt() from debug macro 2020-09-29 14:02:55 -07:00
debug.h net: rtlwifi: Remove in_interrupt() from debug macro 2020-09-29 14:02:55 -07:00
efuse.c rtlwifi: Replace RT_TRACE with rtl_dbg 2020-08-31 18:25:43 +03:00
efuse.h rtlwifi: Remove CamelCase variables from base code 2019-02-19 17:02:51 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci.c net: rtlwifi: Replace in_interrupt() for context detection 2020-09-29 14:02:55 -07:00
pci.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
ps.c rtlwifi: rtl_pci: fix bool comparison in expressions 2021-01-25 16:21:01 +02:00
ps.h net: rtlwifi: Replace in_interrupt() for context detection 2020-09-29 14:02:55 -07:00
pwrseqcmd.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
rc.c mac80211: populate debugfs only after cfg80211 init 2020-04-24 11:30:13 +02:00
rc.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
regd.c rtlwifi: Replace RT_TRACE with rtl_dbg 2020-08-31 18:25:43 +03:00
regd.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
stats.c rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
stats.h rtlwifi: Replace old-style license information 2019-02-19 16:59:43 +02:00
usb.c rtlwifi: implement set_tim by update beacon content 2021-04-21 12:39:33 +03:00
usb.h rtlwifi: Fix blank line errors in main header files 2019-02-28 10:30:01 +02:00
wifi.h rtlwifi: implement set_tim by update beacon content 2021-04-21 12:39:33 +03:00