diff mbox series

[1/4] iommu/rockchip: replace 4 with sizeof(u32)

Message ID 20211204152428.13899-1-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
In log_iova, multiply by 4 is used to calculate the
addresses. In other places in this driver, sizeof(u3)
is used. So replace 4 with sizeof(u32) for consistency

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

Patch

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 5cb260820eda..bd22d0a6eaf0 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -580,14 +580,14 @@  static void log_iova(struct rk_iommu *iommu, int index, dma_addr_t iova)
 	mmu_dte_addr = rk_iommu_read(base, RK_MMU_DTE_ADDR);
 	mmu_dte_addr_phys = rk_ops->dte_addr_phys(mmu_dte_addr);
 
-	dte_addr_phys = mmu_dte_addr_phys + (4 * dte_index);
+	dte_addr_phys = mmu_dte_addr_phys + sizeof(u32) * dte_index;
 	dte_addr = phys_to_virt(dte_addr_phys);
 	dte = *dte_addr;
 
 	if (!rk_dte_is_pt_valid(dte))
 		goto print_it;
 
-	pte_addr_phys = rk_ops->pt_address(dte) + (pte_index * 4);
+	pte_addr_phys = rk_ops->pt_address(dte) + pte_index * sizeof(u32);
 	pte_addr = phys_to_virt(pte_addr_phys);
 	pte = *pte_addr;