brcmfmac: remove set but not used variable 'dtim_period'
authorYueHaibing <yuehaibing@huawei.com>
Wed, 24 Jul 2019 14:12:01 +0000 (22:12 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Aug 2019 12:35:00 +0000 (15:35 +0300)
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2962:5: warning: variable dtim_period set but not used [-Wunused-but-set-variable]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2961:6: warning: variable beacon_interval set but not used [-Wunused-but-set-variable]

They are never used so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

index a5447519e1ab3c8d0e55ec2e2c3b676fc0d5d2cd..581d0013f33eaf17a836bcb2d0e7052da3f86c2b 100644 (file)
@@ -2982,8 +2982,6 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
        struct brcmf_pub *drvr = cfg->pub;
        struct brcmf_bss_info_le *bi;
        const struct brcmf_tlv *tim;
-       u16 beacon_interval;
-       u8 dtim_period;
        size_t ie_len;
        u8 *ie;
        s32 err = 0;
@@ -3007,12 +3005,9 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
 
        ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
        ie_len = le32_to_cpu(bi->ie_length);
-       beacon_interval = le16_to_cpu(bi->beacon_period);
 
        tim = brcmf_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
-       if (tim)
-               dtim_period = tim->data[1];
-       else {
+       if (!tim) {
                /*
                * active scan was done so we could not get dtim
                * information out of probe response.
@@ -3024,7 +3019,6 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
                        bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
                        goto update_bss_info_out;
                }
-               dtim_period = (u8)var;
        }
 
 update_bss_info_out: