diff options
author | Anilkumar Kolli <akolli@codeaurora.org> | 2019-11-27 14:08:50 +0000 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-11-29 09:47:05 +0200 |
commit | 0c408515cd3b6fb980ec31213c0e55bbbe74d975 (patch) | |
tree | 7ab617655046417abc2947f57b5f1d92f0e4532e /drivers/net/wireless/ath/ath11k/qmi.c | |
parent | d6af906d8307a804a1af488564def0264ea57282 (diff) |
ath11k: qmi clean up in ath11k_qmi_wlanfw_wlan_cfg_send()
Use pipe_id id instead of ret in for loop.
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/qmi.c')
-rw-r--r-- | drivers/net/wireless/ath/ath11k/qmi.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index adf41f28a231..2377895a58ec 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -2016,7 +2016,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) struct ce_pipe_config *ce_cfg; struct service_to_pipe *svc_cfg; struct qmi_txn txn = {}; - int ret = 0; + int ret = 0, pipe_num; ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; @@ -2033,24 +2033,22 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) req->tgt_cfg_valid = 1; /* This is number of CE configs */ - req->tgt_cfg_len = ((ab->qmi.ce_cfg.tgt_ce_len) / - (sizeof(struct ce_pipe_config))) - 1; - for (ret = 0; ret <= req->tgt_cfg_len ; ret++) { - req->tgt_cfg[ret].pipe_num = ce_cfg[ret].pipenum; - req->tgt_cfg[ret].pipe_dir = ce_cfg[ret].pipedir; - req->tgt_cfg[ret].nentries = ce_cfg[ret].nentries; - req->tgt_cfg[ret].nbytes_max = ce_cfg[ret].nbytes_max; - req->tgt_cfg[ret].flags = ce_cfg[ret].flags; + req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len; + for (pipe_num = 0; pipe_num <= req->tgt_cfg_len ; pipe_num++) { + req->tgt_cfg[pipe_num].pipe_num = ce_cfg[pipe_num].pipenum; + req->tgt_cfg[pipe_num].pipe_dir = ce_cfg[pipe_num].pipedir; + req->tgt_cfg[pipe_num].nentries = ce_cfg[pipe_num].nentries; + req->tgt_cfg[pipe_num].nbytes_max = ce_cfg[pipe_num].nbytes_max; + req->tgt_cfg[pipe_num].flags = ce_cfg[pipe_num].flags; } req->svc_cfg_valid = 1; /* This is number of Service/CE configs */ - req->svc_cfg_len = (ab->qmi.ce_cfg.svc_to_ce_map_len) / - (sizeof(struct service_to_pipe)); - for (ret = 0; ret < req->svc_cfg_len; ret++) { - req->svc_cfg[ret].service_id = svc_cfg[ret].service_id; - req->svc_cfg[ret].pipe_dir = svc_cfg[ret].pipedir; - req->svc_cfg[ret].pipe_num = svc_cfg[ret].pipenum; + req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len; + for (pipe_num = 0; pipe_num < req->svc_cfg_len; pipe_num++) { + req->svc_cfg[pipe_num].service_id = svc_cfg[pipe_num].service_id; + req->svc_cfg[pipe_num].pipe_dir = svc_cfg[pipe_num].pipedir; + req->svc_cfg[pipe_num].pipe_num = svc_cfg[pipe_num].pipenum; } req->shadow_reg_valid = 0; req->shadow_reg_v2_valid = 0; |