]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: avoid redundant code in Rx cookie conversion init
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Thu, 18 Apr 2024 15:30:23 +0000 (18:30 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Mon, 22 Apr 2024 12:06:30 +0000 (15:06 +0300)
Currently, in the Rx data path cookie conversion initialization procedure,
the primary page table index (ppt_idx) is computed within the secondary
page table iteration. However this is invariant, and hence the ppt_idx
should be calculated outside of the iteration to avoid repeated execution
of the statement.

Found in code review.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240411102226.4045323-2-quic_periyasa@quicinc.com
drivers/net/wireless/ath/ath12k/dp.c

index a0aa8c5718674f85bce848c1fe1f6c32439a7625..796c757c0f58b1c588fca9b9447182f61b04f73e 100644 (file)
@@ -1425,10 +1425,11 @@ static int ath12k_dp_cc_desc_init(struct ath12k_base *ab)
                        }
 
                        tx_spt_page = i + pool_id * ATH12K_TX_SPT_PAGES_PER_POOL;
+                       ppt_idx = ATH12K_NUM_RX_SPT_PAGES + tx_spt_page;
+
                        dp->spt_info->txbaddr[tx_spt_page] = &tx_descs[0];
 
                        for (j = 0; j < ATH12K_MAX_SPT_ENTRIES; j++) {
-                               ppt_idx = ATH12K_NUM_RX_SPT_PAGES + tx_spt_page;
                                tx_descs[j].desc_id = ath12k_dp_cc_cookie_gen(ppt_idx, j);
                                tx_descs[j].pool_id = pool_id;
                                list_add_tail(&tx_descs[j].list,