From patchwork Sat Dec 4 15:24:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 12694771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 151B2C433EF for ; Sat, 4 Dec 2021 15:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TIXBVDhQl9vbG8Z+NSds4sazWWMAQxWiY69lP9Fa9Sk=; b=kaIxSxt6MI7VyQ BismjEHgHvaXIS5BZ4To820nyr00VrVREP8ycr8VFBAHQ4J9Khl80K7w1cKlz9HfWz7XKZYN5hgAR JjJMoeVvhx6HMGwdOvLED42sexfDgSSKjW5hLRlpBXlQNYNlOl7xYaa1CyemPpJVGytQAGIUZGbNY m5hcMEO+5R54aBYk7rjW7RvZok4aKegSKkEXNHvM260qoo1nDFbzsQWRlHiW/sSP/fRk2ON8+TJV6 qZWlka7cHgPZ8kqEu3IQXeMNLlhpipM9uP/yCkf7G3gohvEBpWZbU69o6l4WqmBu5eh7C4d4Rj2vc B1KLlCvJqyvbbt3wVBFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWuK-000ST2-RM; Sat, 04 Dec 2021 15:25:00 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtWu7-000SPt-40; Sat, 04 Dec 2021 15:24:48 +0000 Received: from localhost.localdomain (unknown [IPv6:2a00:c281:1409:4a00:6988:6ac4:851c:3f63]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 14BE31F45C02; Sat, 4 Dec 2021 15:24:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1638631483; bh=H8N9l6Mnl7wSw3Je5KLmnGKYDyH1sMJryKMaYLsbsV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OgiDW9mVSLkthGLSK+4bwSG829/yDcX9wj4K+eMdI6ExJeOYXGBTyhs/1ovr4/ETN 1DcL7rqArlDUVFNnT4dl0WKKATfhyZ3dQqMToJC+a7TgO1N/nDdafoF94EuzEt6cZf 9ADZDh9GSPDdlcxy5tL9NbAR8qPRfLsrAu3tVEtJ/eX2XO1g83HZiXgAU1jxOPvBJC ZJpc2K1Fb8F+1l4jOEAKX2nOgXGc0KKILfA2MGyH9jiG3ImayEEfMi5yWLm9DoEDcE wl/o+yCZyzTQ+9d5ARVm+CqYCG4gkrGYRtFv5taTH+G2gGjmWnsTcLr90D/EkHjlGs e4Aqij+/jjYqw== From: Dafna Hirschfeld To: iommu@lists.linux-foundation.org Cc: Dafna Hirschfeld , Joerg Roedel , Will Deacon , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), kernel@collabora.com Subject: [PATCH 2/4] iommu/rockchip: remove redundant var dte_addr Date: Sat, 4 Dec 2021 17:24:26 +0200 Message-Id: <20211204152428.13899-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> References: <20211204152428.13899-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211204_072447_340015_E2BDC34F X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Using dte_addr as local var is redundant. Instead acces rk_domain->dt[dte_index] directly. Signed-off-by: Dafna Hirschfeld --- 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);