wcn36xx: Remove dead code in wcn36xx_smd_config_bss()
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 10 Sep 2020 15:06:31 +0000 (16:06 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 21 Sep 2020 13:17:14 +0000 (16:17 +0300)
wcn36xx_smd_config_bss_v0() and wcn36xx_smd_config_bss_v1() have been
designed to operate in standalone fashion. As a result we can drop the
dead code now present in wcn36xx_smd_config_bss() and happily remove one
kzalloc from the BSS config path as we do so.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910150631.2178970-8-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/smd.c

index 5ae6a2ccfebcbabe93e2f6bdf468890d2b56415b..05e5e079dab301bc6ddd52f370035b7a9b69a949 100644 (file)
@@ -1697,42 +1697,15 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
                           struct ieee80211_sta *sta, const u8 *bssid,
                           bool update)
 {
-       struct wcn36xx_hal_config_bss_req_msg *msg;
-       struct wcn36xx_hal_config_bss_params *bss;
-       struct wcn36xx_hal_config_sta_params *sta_params;
        int ret;
 
        mutex_lock(&wcn->hal_mutex);
-       msg = kzalloc(sizeof(*msg), GFP_KERNEL);
-       if (!msg) {
-               ret = -ENOMEM;
-               goto out;
-       }
-       INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ);
-
-       bss = &msg->bss_params;
-       sta_params = &bss->sta;
-
-       wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
-       wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
-
-       wcn36xx_dbg(WCN36XX_DBG_HAL,
-                   "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n",
-                   bss->bssid, bss->self_mac_addr, bss->bss_type,
-                   bss->oper_mode, bss->nw_type);
 
-       wcn36xx_dbg(WCN36XX_DBG_HAL,
-                   "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n",
-                   sta_params->bssid, sta_params->action,
-                   sta_params->sta_index, sta_params->bssid_index,
-                   sta_params->aid, sta_params->type,
-                   sta_params->mac);
-
-       if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
+       if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24))
                ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update);
-       } else {
+       else
                ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update);
-       }
+
        if (ret) {
                wcn36xx_err("Sending hal_config_bss failed\n");
                goto out;
@@ -1742,12 +1715,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
                                         sta,
                                         wcn->hal_buf,
                                         wcn->hal_rsp_len);
-       if (ret) {
+       if (ret)
                wcn36xx_err("hal_config_bss response failed err=%d\n", ret);
-               goto out;
-       }
+
 out:
-       kfree(msg);
        mutex_unlock(&wcn->hal_mutex);
        return ret;
 }