rtlwifi: Fix unitialized variable warnings
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 14 Apr 2011 02:00:02 +0000 (21:00 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 14 Apr 2011 19:35:14 +0000 (15:35 -0400)
In http://lkml.indiana.edu/hypermail/linux/kernel/1104.1/01955.html, Geerti
Uytterhoeven reports the following warnings for the rtlwifi drivers.

src/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c: warning:
 'cck_index' may be used uninitialized in this function: => 637
src/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c: warning:
 'cck_index_old' may be used uninitialized in this function: => 637
src/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c: warning:
 'box_extreg' may be used uninitialized in this function: => 303
src/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c: warning:
 'box_reg' may be used uninitialized in this function: => 303
src/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c: warning:
 'chnlgroup' may be used uninitialized in this function: => 205
src/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c: warning:
 'u4_regvalue' may be used uninitialized in this function: => 450
src/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c: warning:
 'hq_sele' may be used uninitialized in this function: => 924

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
drivers/net/wireless/rtlwifi/rtl8192ce/rf.c
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c

index bb023274414c9ee65587e45dcdb1e84b130c2e8b..c228b9ee37113a1b0098e34c9d69132b4a67dd33 100644 (file)
@@ -634,7 +634,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
        u8 thermalvalue, delta, delta_lck, delta_iqk;
        long ele_a, ele_d, temp_cck, val_x, value32;
        long val_y, ele_c;
-       u8 ofdm_index[2], cck_index, ofdm_index_old[2], cck_index_old;
+       u8 ofdm_index[2], cck_index = 0, ofdm_index_old[2], cck_index_old = 0;
        int i;
        bool is2t = IS_92C_SERIAL(rtlhal->version);
        u8 txpwr_level[2] = {0, 0};
index f107660f545dc71c92074a9b8a937971baee7406..bc9d24134ac4d155d6db882eb250fec29562a2f3 100644 (file)
@@ -293,7 +293,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
        u8 boxnum;
-       u16 box_reg, box_extreg;
+       u16 box_reg = 0, box_extreg = 0;
        u8 u1b_tmp;
        bool isfw_read = false;
        bool bwrite_sucess = false;
index 669b1168dbec8d75ce57477569b6f26efcb01933..e301b12e281afa5505709f8e5f97a13deac8f8ec 100644 (file)
@@ -202,7 +202,7 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_phy *rtlphy = &(rtlpriv->phy);
        struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
-       u8 i, chnlgroup, pwr_diff_limit[4];
+       u8 i, chnlgroup = 0, pwr_diff_limit[4];
        u32 writeVal, customer_limit, rf;
 
        for (rf = 0; rf < 2; rf++) {
@@ -447,7 +447,7 @@ static bool _rtl92c_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_phy *rtlphy = &(rtlpriv->phy);
-       u32 u4_regvalue;
+       u32 u4_regvalue = 0;
        u8 rfpath;
        bool rtstatus;
        struct bb_reg_def *pphyreg;
index 9444e76838cfe59fb95938c6a769d7af031c0980..e43be254782787e57b13fcabb9e77b13929baaf4 100644 (file)
@@ -921,7 +921,7 @@ static void _rtl92cu_init_chipT_queue_priority(struct ieee80211_hw *hw,
                                               u8 out_ep_num,
                                               u8 queue_sel)
 {
-       u8      hq_sele;
+       u8 hq_sele = 0;
        struct rtl_priv *rtlpriv = rtl_priv(hw);
 
        switch (out_ep_num) {