From 8ad3d6962fa1f8d50449aaa5eac9b3df59ad7ee0 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 8 Mar 2016 09:48:16 +0800 Subject: [PATCH] iommu: rk-iovmm: fix back to back sg entries condition Change-Id: Ie493d3d8b34ac4229b3a5a2a84cd52568425f106 Signed-off-by: Simon --- drivers/iommu/rk-iovmm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iommu/rk-iovmm.c b/drivers/iommu/rk-iovmm.c index 9aebb5bbabfd..3dfa109e4361 100644 --- a/drivers/iommu/rk-iovmm.c +++ b/drivers/iommu/rk-iovmm.c @@ -98,17 +98,15 @@ dma_addr_t rockchip_iovmm_map(struct device *dev, addr = start; do { phys_addr_t phys; - struct scatterlist *sg_tmp; size_t len; phys = sg_phys(sg); len = sg->length; /* if back to back sg entries are contiguous consolidate them */ - sg_tmp = sg_next(sg); while (sg_next(sg) && sg_phys(sg) + sg->length == sg_phys(sg_next(sg))) { - len += sg_tmp->length; sg = sg_next(sg); + len += sg->length; } if (offset > 0) { -- 2.34.1