1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/realtek/rtlwifi/rtl8192de
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
..
def.h rtlwifi: rtl8188ee: rtl8192ce: rtl8192de: rtl8723ae: rtl8821ae: Remove some unused bit manipulation macros 2019-09-13 17:55:40 +03:00
dm.c rtlwifi: rtl8192de: fix ofdm power compensation 2020-12-09 09:22:37 +02:00
dm.h rtlwifi: rtl8188de: Remove CamelCase variables 2019-02-19 17:03:00 +02:00
fw.c rtlwifi: rtl8192de: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:56 +03:00
fw.h rtlwifi: rtl8192de: Remove usage of private bit manipulation macros 2019-12-18 20:22:26 +02:00
hw.c rtlwifi: rtl8192de: fix comparison to bool warning in hw.c 2020-09-21 16:02:49 +03:00
hw.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
led.c rtlwifi: rtl8192de: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:56 +03:00
led.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy.c rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() 2021-08-29 10:28:32 +03:00
phy.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
reg.h rtlwifi: rtl8188de: Remove CamelCase variables 2019-02-19 17:03:00 +02:00
rf.c rtlwifi: rtl8192de: Rename RT_TRACE to rtl_dbg 2020-08-31 18:25:56 +03:00
rf.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
sw.c rtlwifi: rtl8192de: Use DEFINE_SPINLOCK() for spinlock 2021-04-17 20:34:12 +03:00
sw.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
table.c rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
table.h rtlwifi: rtl8192de: Replace old-style license information 2019-02-19 17:00:08 +02:00
trx.c rtlwifi: rtl8192de: avoid accessing the data mapped to streaming DMA 2020-11-24 17:06:37 +02:00
trx.h rtlwifi: rtl8192de: Convert inline routines to little-endian words 2019-12-18 20:21:39 +02:00