rtl8192se: Fix warnings from gcc 4.6.0
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 23 May 2011 01:54:43 +0000 (20:54 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 1 Jun 2011 19:12:30 +0000 (15:12 -0400)
gcc 4.6.0 warnings for rtl8192se:

  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/dm.o
drivers/net/wireless/rtlwifi/rtl8192se/dm.c: In function ‘_rtl92s_dm_refresh_rateadaptive_mask’:
drivers/net/wireless/rtlwifi/rtl8192se/dm.c:225:5: warning: variable ‘rssi_level’ set but not used [-Wunused-but-set-variable]
  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/fw.o
drivers/net/wireless/rtlwifi/rtl8192se/fw.c: In function ‘rtl92s_download_fw’:
drivers/net/wireless/rtlwifi/rtl8192se/fw.c:361:6: warning: variable ‘file_length’ set but not used [-Wunused-but-set-variable]
  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/hw.o
drivers/net/wireless/rtlwifi/rtl8192se/hw.c: In function ‘_rtl92se_hw_configure’:
drivers/net/wireless/rtlwifi/rtl8192se/hw.c:887:6: warning: variable ‘reg_ratr’ set but not used [-Wunused-but-set-variable]
drivers/net/wireless/rtlwifi/rtl8192se/hw.c: In function ‘_rtl92se_set_media_status’:
drivers/net/wireless/rtlwifi/rtl8192se/hw.c:1125:20: warning: variable ‘ledaction’ set but not used [-Wunused-but-set-variable]
drivers/net/wireless/rtlwifi/rtl8192se/hw.c: In function ‘rtl92se_gpio_radio_on_off_checking’:
drivers/net/wireless/rtlwifi/rtl8192se/hw.c:2274:32: warning: variable ‘cur_rfstate’ set but not used [-Wunused-but-set-variable]
  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/phy.o
drivers/net/wireless/rtlwifi/rtl8192se/phy.c: In function ‘rtl92s_phy_set_bw_mode’:
drivers/net/wireless/rtlwifi/rtl8192se/phy.c:266:5: warning: variable ‘reg_prsr_rsc’ set but not used [-Wunused-but-set-variable]
  CC [M]  drivers/net/wireless/rtlwifi/rtl8192se/trx.o
drivers/net/wireless/rtlwifi/rtl8192se/trx.c: In function ‘_rtl92se_translate_rx_signal_stuff’:
drivers/net/wireless/rtlwifi/rtl8192se/trx.c:584:6: warning: variable ‘psaddr’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192se/dm.c
drivers/net/wireless/rtlwifi/rtl8192se/fw.c
drivers/net/wireless/rtlwifi/rtl8192se/hw.c
drivers/net/wireless/rtlwifi/rtl8192se/phy.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c

index da86db86fa4a9ac3c8b6d6692d301343892f4368..609c7ec7e66a2da27635550978d7dd1f36b70fb8 100644 (file)
@@ -222,7 +222,6 @@ static void _rtl92s_dm_refresh_rateadaptive_mask(struct ieee80211_hw *hw)
        u32 low_rssi_thresh = 0;
        u32 middle_rssi_thresh = 0;
        u32 high_rssi_thresh = 0;
-       u8 rssi_level;
        struct ieee80211_sta *sta = NULL;
 
        if (is_hal_stop(rtlhal))
@@ -272,18 +271,14 @@ static void _rtl92s_dm_refresh_rateadaptive_mask(struct ieee80211_hw *hw)
                if (rtlpriv->dm.undecorated_smoothed_pwdb >
                    (long)high_rssi_thresh) {
                        ra->ratr_state = DM_RATR_STA_HIGH;
-                       rssi_level = 1;
                } else if (rtlpriv->dm.undecorated_smoothed_pwdb >
                           (long)middle_rssi_thresh) {
                        ra->ratr_state = DM_RATR_STA_LOW;
-                       rssi_level = 3;
                } else if (rtlpriv->dm.undecorated_smoothed_pwdb >
                           (long)low_rssi_thresh) {
                        ra->ratr_state = DM_RATR_STA_LOW;
-                       rssi_level = 5;
                } else {
                        ra->ratr_state = DM_RATR_STA_ULTRALOW;
-                       rssi_level = 6;
                }
 
                if (ra->pre_ratr_state != ra->ratr_state) {
index 3b5af0113d7f9ad86c5d98515bd733aa95313193..6f91a148c2220ad2f4694c21a4f47e52822912e2 100644 (file)
@@ -358,7 +358,6 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
        struct fw_priv *pfw_priv = NULL;
        u8 *puc_mappedfile = NULL;
        u32 ul_filelength = 0;
-       u32 file_length = 0;
        u8 fwhdr_size = RT_8192S_FIRMWARE_HDR_SIZE;
        u8 fwstatus = FW_STATUS_INIT;
        bool rtstatus = true;
@@ -370,7 +369,6 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
        firmware->fwstatus = FW_STATUS_INIT;
 
        puc_mappedfile = firmware->sz_fw_tmpbuffer;
-       file_length = firmware->sz_fw_tmpbufferlen;
 
        /* 1. Retrieve FW header. */
        firmware->pfwheader = (struct fw_hdr *) puc_mappedfile;
index 2e9005d0454bc2f4f45f0d8d7e8647090f3fdfac..6ff0caca9584a2f39df295953e588d0eb5304093 100644 (file)
@@ -884,12 +884,10 @@ static void _rtl92se_hw_configure(struct ieee80211_hw *hw)
        struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 
        u8 reg_bw_opmode = 0;
-       u32 reg_ratr = 0, reg_rrsr = 0;
+       u32 reg_rrsr = 0;
        u8 regtmp = 0;
 
        reg_bw_opmode = BW_OPMODE_20MHZ;
-       reg_ratr = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS |
-                               RATE_ALL_OFDM_2SS;
        reg_rrsr = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
 
        regtmp = rtl_read_byte(rtlpriv, INIRTSMCS_SEL);
@@ -1122,14 +1120,12 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        u8 bt_msr = rtl_read_byte(rtlpriv, MSR);
-       enum led_ctl_mode ledaction = LED_CTL_NO_LINK;
        u32 temp;
        bt_msr &= ~MSR_LINK_MASK;
 
        switch (type) {
        case NL80211_IFTYPE_UNSPECIFIED:
                bt_msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
-               ledaction = LED_CTL_LINK;
                RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
                         ("Set Network type to NO LINK!\n"));
                break;
@@ -1140,7 +1136,6 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
                break;
        case NL80211_IFTYPE_STATION:
                bt_msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT);
-               ledaction = LED_CTL_LINK;
                RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
                         ("Set Network type to STA!\n"));
                break;
@@ -2271,7 +2266,7 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
-       enum rf_pwrstate rfpwr_toset, cur_rfstate;
+       enum rf_pwrstate rfpwr_toset /*, cur_rfstate */;
        unsigned long flag = 0;
        bool actuallyset = false;
        bool turnonbypowerdomain = false;
@@ -2292,7 +2287,7 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
                spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flag);
        }
 
-       cur_rfstate = ppsc->rfpwr_state;
+       /* cur_rfstate = ppsc->rfpwr_state;*/
 
        /* because after _rtl92s_phy_set_rfhalt, all power
         * closed, so we must open some power for GPIO check,
index 63b45e60a95e5c6a4a80b64acbac6febc3b26c6d..a26713b5afb51f50d382a514a03b9925dfcbbe05 100644 (file)
@@ -263,7 +263,6 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
        struct rtl_phy *rtlphy = &(rtlpriv->phy);
        struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
        u8 reg_bw_opmode;
-       u8 reg_prsr_rsc;
 
        RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("Switch to %s bandwidth\n",
                  rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
@@ -277,7 +276,8 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
        rtlphy->set_bwmode_inprogress = true;
 
        reg_bw_opmode = rtl_read_byte(rtlpriv, BW_OPMODE);
-       reg_prsr_rsc = rtl_read_byte(rtlpriv, RRSR + 2);
+       /* dummy read */
+       rtl_read_byte(rtlpriv, RRSR + 2);
 
        switch (rtlphy->current_chan_bw) {
        case HT_CHANNEL_WIDTH_20:
index 5cf442373d46e63717949a7c4bb8d06e9aaa7848..14a8b7866c0d884fc20344c17b3ec0a42c203322 100644 (file)
@@ -581,7 +581,6 @@ static void _rtl92se_translate_rx_signal_stuff(struct ieee80211_hw *hw,
        struct ieee80211_hdr *hdr;
        u8 *tmp_buf;
        u8 *praddr;
-       u8 *psaddr;
        __le16 fc;
        u16 type, cfc;
        bool packet_matchbssid, packet_toself, packet_beacon;
@@ -593,7 +592,6 @@ static void _rtl92se_translate_rx_signal_stuff(struct ieee80211_hw *hw,
        cfc = le16_to_cpu(fc);
        type = WLAN_FC_GET_TYPE(fc);
        praddr = hdr->addr1;
-       psaddr = hdr->addr2;
 
        packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) &&
             (!compare_ether_addr(mac->bssid, (cfc & IEEE80211_FCTL_TODS) ?