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

Dafna Hirschfeld dafna.hirschfeld at collabora.com
Sat Dec 4 07:24:26 PST 2021


Using dte_addr as local var is redundant.
Instead acces rk_domain->dt[dte_index] directly.

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

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);
-- 
2.17.1




More information about the Linux-rockchip mailing list