diff mbox series

[2/4] iommu/rockchip: remove redundant var dte_addr

Message ID 20211204152428.13899-2-dafna.hirschfeld@collabora.com (mailing list archive)
State New, archived
Headers show
Series [1/4] iommu/rockchip: replace 4 with sizeof(u32) | expand

Commit Message

Dafna Hirschfeld Dec. 4, 2021, 3:24 p.m. UTC
Using dte_addr as local var is redundant.
Instead acces rk_domain->dt[dte_index] directly.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/iommu/rockchip-iommu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index bd22d0a6eaf0..bd73cf9c54f5 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -744,7 +744,7 @@  static void rk_iommu_zap_iova_first_last(struct rk_iommu_domain *rk_domain,
 static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain,
 				  dma_addr_t iova)
 {
-	u32 *page_table, *dte_addr;
+	u32 *page_table;
 	u32 dte_index, dte;
 	phys_addr_t pt_phys;
 	dma_addr_t pt_dma;
@@ -752,8 +752,8 @@  static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain,
 	assert_spin_locked(&rk_domain->dt_lock);
 
 	dte_index = rk_iova_dte_index(iova);
-	dte_addr = &rk_domain->dt[dte_index];
-	dte = *dte_addr;
+	dte = rk_domain->dt[dte_index];
+
 	if (rk_dte_is_pt_valid(dte))
 		goto done;
 
@@ -769,7 +769,7 @@  static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain,
 	}
 
 	dte = rk_ops->mk_dtentries(pt_dma);
-	*dte_addr = dte;
+	rk_domain->dt[dte_index] = dte;
 
 	rk_table_flush(rk_domain,
 		       rk_domain->dt_dma + dte_index * sizeof(u32), 1);