DORMANTno replies

[PATCH] rtlwifi: rtl8192se: Fix gcc 4.7.x warning

From: Larry Finger <hidden>
Date: 2012-06-20 16:47:29

With gcc 4.7.x, the following warning is issued as the routine that sets
the array has the possibility of not initializing the values:
 
  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/phy.o
drivers/net/wireless/rtlwifi/rtl8192se/phy.c: In function ‘rtl92s_phy_set_txpower’:
drivers/net/wireless/rtlwifi/rtl8192se/phy.c:1268:23: warning: ‘ofdmpowerLevel[0]’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Larry Finger <redacted>
---

John,

This problem exists for all versions of rtl8192se, but earlier compiler
versions did not detect it. For that reason, I am recommending this patch
be applied to 3.6.

Larry

Index: wireless-testing/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
@@ -1247,6 +1247,9 @@ static void _rtl92s_phy_get_txpower_inde
 		/* Read HT 40 OFDM TX power */
 		ofdmpowerLevel[0] = rtlefuse->txpwrlevel_ht40_2s[0][index];
 		ofdmpowerLevel[1] = rtlefuse->txpwrlevel_ht40_2s[1][index];
+	} else {
+		ofdmpowerLevel[0] = 0;
+		ofdmpowerLevel[1] = 0;
 	}
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help