diff options
author | P Praneesh <ppranees@codeaurora.org> | 2021-11-12 11:02:45 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2021-11-15 11:21:54 +0200 |
commit | a8508bf7ced2e43f30b46333f09cbc79a1675616 (patch) | |
tree | ca851b13f7f4be5c12070c5a6a50e4058607393d | |
parent | d0e2523bfa9cb391fe966b0b6948c7e438981361 (diff) | |
download | linux-a8508bf7ced2e43f30b46333f09cbc79a1675616.tar.gz |
ath11k: remove mod operator in dst ring processing
Replace use of mod operator with a manual wrap around to avoid additional cost of using mod operation. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Sriram R <srirrama@codeaurora.org> Signed-off-by: Sriram R <srirrama@codeaurora.org> Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Signed-off-by: P Praneesh <ppranees@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1630560820-21905-10-git-send-email-ppranees@codeaurora.org
-rw-r--r-- | drivers/net/wireless/ath/ath11k/hal.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath11k/hal.c b/drivers/net/wireless/ath/ath11k/hal.c index f04edafbd0f1..7cf9e23cb922 100644 --- a/drivers/net/wireless/ath/ath11k/hal.c +++ b/drivers/net/wireless/ath/ath11k/hal.c @@ -654,8 +654,11 @@ u32 *ath11k_hal_srng_dst_get_next_entry(struct ath11k_base *ab, desc = srng->ring_base_vaddr + srng->u.dst_ring.tp; - srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size) % - srng->ring_size; + srng->u.dst_ring.tp += srng->entry_size; + + /* wrap around to start of ring*/ + if (srng->u.dst_ring.tp == srng->ring_size) + srng->u.dst_ring.tp = 0; /* Try to prefetch the next descriptor in the ring */ if (srng->flags & HAL_SRNG_FLAGS_CACHED) |