diff mbox series

wifi: rtlwifi: rtl8192du: Initialise value32 in _rtl92du_init_queue_reserved_page

Message ID 2a808244-93d0-492c-b304-ae1974df5df9@gmail.com (mailing list archive)
State Accepted
Commit f1cb9d5aefba07fc52b06b7bd5fdcd9ef91157b4
Delegated to: Kalle Valo
Headers show
Series wifi: rtlwifi: rtl8192du: Initialise value32 in _rtl92du_init_queue_reserved_page | expand

Commit Message

Bitterblue Smith Aug. 6, 2024, 4:20 p.m. UTC
GCC complains:

   In file included from include/linux/ieee80211.h:21,
                    from include/net/mac80211.h:20,
                    from drivers/net/wireless/realtek/rtlwifi/rtl8192du/../wifi.h:14,
                    from drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:4:
   In function 'u32p_replace_bits',
       inlined from '_rtl92du_init_queue_reserved_page.isra' at drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:225:2:
>> include/linux/bitfield.h:189:18: warning: 'value32' is used uninitialized [-Wuninitialized]

Part of the variable is indeed left uninitialised.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408062100.DWhN0CYH-lkp@intel.com/
Fixes: e769c67105d3 ("wifi: rtlwifi: Add rtl8192du/hw.{c,h}")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
Kalle and Ping-Ke,

Kernel 6.11 will be the first one to include this driver.
Should this patch go to the wireless tree?
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Aug. 6, 2024, 4:30 p.m. UTC | #1
Bitterblue Smith <rtl8821cerfe2@gmail.com> writes:

> GCC complains:
>
>    In file included from include/linux/ieee80211.h:21,
>                     from include/net/mac80211.h:20,
>                     from drivers/net/wireless/realtek/rtlwifi/rtl8192du/../wifi.h:14,
>                     from drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:4:
>    In function 'u32p_replace_bits',
>        inlined from '_rtl92du_init_queue_reserved_page.isra' at drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:225:2:
>>> include/linux/bitfield.h:189:18: warning: 'value32' is used uninitialized [-Wuninitialized]
>
> Part of the variable is indeed left uninitialised.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202408062100.DWhN0CYH-lkp@intel.com/
> Fixes: e769c67105d3 ("wifi: rtlwifi: Add rtl8192du/hw.{c,h}")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
> Kalle and Ping-Ke,
>
> Kernel 6.11 will be the first one to include this driver.
> Should this patch go to the wireless tree?

Yes, compiler warning fixes should be always sent to Linus ASAP. Ping,
if you agree please assign the patch to me.
Ping-Ke Shih Aug. 7, 2024, 12:57 a.m. UTC | #2
Kalle Valo <kvalo@kernel.org> wrote:
> 
> Bitterblue Smith <rtl8821cerfe2@gmail.com> writes:
> 
> > Kernel 6.11 will be the first one to include this driver.
> > Should this patch go to the wireless tree?
> 
> Yes, compiler warning fixes should be always sent to Linus ASAP. Ping,
> if you agree please assign the patch to me.
> 

Assigned. Thanks.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Kalle Valo Aug. 7, 2024, 5:12 p.m. UTC | #3
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:

> GCC complains:
> 
>    In file included from include/linux/ieee80211.h:21,
>                     from include/net/mac80211.h:20,
>                     from drivers/net/wireless/realtek/rtlwifi/rtl8192du/../wifi.h:14,
>                     from drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:4:
>    In function 'u32p_replace_bits',
>        inlined from '_rtl92du_init_queue_reserved_page.isra' at drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c:225:2:
> >> include/linux/bitfield.h:189:18: warning: 'value32' is used uninitialized [-Wuninitialized]
> 
> Part of the variable is indeed left uninitialised.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202408062100.DWhN0CYH-lkp@intel.com/
> Fixes: e769c67105d3 ("wifi: rtlwifi: Add rtl8192du/hw.{c,h}")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless.git, thanks.

f1cb9d5aefba wifi: rtlwifi: rtl8192du: Initialise value32 in _rtl92du_init_queue_reserved_page
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c
index 700c6e2bcad1..ff458fb8514d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.c
@@ -181,11 +181,11 @@  static void _rtl92du_init_queue_reserved_page(struct ieee80211_hw *hw,
 	struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
 	u32 txqpagenum, txqpageunit;
 	u32 txqremainingpage;
+	u32 value32 = 0;
 	u32 numhq = 0;
 	u32 numlq = 0;
 	u32 numnq = 0;
 	u32 numpubq;
-	u32 value32;
 
 	if (rtlhal->macphymode != SINGLEMAC_SINGLEPHY) {
 		numpubq = NORMAL_PAGE_NUM_PUBQ_92D_DUAL_MAC;