From patchwork Thu May 14 12:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 11548653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D105A739 for ; Thu, 14 May 2020 12:46:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A12982065D for ; Thu, 14 May 2020 12:46:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CJ4cE8mw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A12982065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=C4welo8tvap4Z3jG/ND9E1pGfogydNiHMw25OLSGozA=; b=CJ4cE8mwH69fSD DnxGmDkDuxAowUqelYfFtR6ihsZ21RKGum/WvCWa0LKMk8uLO1bhAbdZTBPRSmd1vv/PrRR/XOtfa D3k/wUBrJhGVtTy1FLb+zY5gdxjWralRVLAECeXDL3jw6EixfhyQ5kHAaj6i4bspyI/epPd66FYAE fTd2RX8T/SGZ2FOmfoyrwdAGcKrJlh9TG8dgmTUZIvKasBTRNrp6pT6TlMGuYv1SEARWhOeDiA2hv 6McA+DykRTk5169mmmsDze8GUPHZUJrWRl+lzfrzYdrp6BdLvskpNP3oDkwjBjPbDxoYpNJju411I Akk3bIgZVSx7cNcaVehQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZDFw-0004Bn-MY; Thu, 14 May 2020 12:46:32 +0000 Received: from 8bytes.org ([81.169.241.247] helo=theia.8bytes.org) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZDFs-0004AX-PX for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 12:46:30 +0000 Received: by theia.8bytes.org (Postfix, from userid 1000) id 9035C452; Thu, 14 May 2020 14:46:22 +0200 (CEST) From: Joerg Roedel To: Maxime Ripard Subject: [PATCH 1/2] iommu/sun50i: Fix compile warnings Date: Thu, 14 May 2020 14:46:20 +0200 Message-Id: <20200514124621.25999-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_054629_475802_52E77C8A X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [81.169.241.247 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Maxime Ripard , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Joerg Roedel A few compile warnings show up when building this driver: CC drivers/iommu/sun50i-iommu.o drivers/iommu/sun50i-iommu.c: In function ‘sun50i_dte_get_page_table’: drivers/iommu/sun50i-iommu.c:486:16: warning: unused variable ‘flags’ [-Wunused-variable] 486 | unsigned long flags; | ^~~~~ drivers/iommu/sun50i-iommu.c: In function ‘sun50i_iommu_unmap’: drivers/iommu/sun50i-iommu.c:559:23: warning: unused variable ‘iommu’ [-Wunused-variable] 559 | struct sun50i_iommu *iommu = sun50i_domain->iommu; | ^~~~~ drivers/iommu/sun50i-iommu.c: In function ‘sun50i_iommu_probe_device’: drivers/iommu/sun50i-iommu.c:749:22: warning: unused variable ‘group’ [-Wunused-variable] 749 | struct iommu_group *group; | ^~~~~ Remove the unused variables. Cc: Maxime Ripard Signed-off-by: Joerg Roedel --- drivers/iommu/sun50i-iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 989d87aa4426..a52f52eff7c8 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -483,7 +483,6 @@ static u32 *sun50i_dte_get_page_table(struct sun50i_iommu_domain *sun50i_domain, dma_addr_t iova, gfp_t gfp) { struct sun50i_iommu *iommu = sun50i_domain->iommu; - unsigned long flags; u32 *page_table; u32 *dte_addr; u32 old_dte; @@ -556,7 +555,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova size_t size, struct iommu_iotlb_gather *gather) { struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain); - struct sun50i_iommu *iommu = sun50i_domain->iommu; phys_addr_t pt_phys; dma_addr_t pte_dma; u32 *pte_addr; @@ -746,7 +744,6 @@ static int sun50i_iommu_attach_device(struct iommu_domain *domain, static struct iommu_device *sun50i_iommu_probe_device(struct device *dev) { struct sun50i_iommu *iommu; - struct iommu_group *group; iommu = sun50i_iommu_from_dev(dev); if (!iommu) From patchwork Thu May 14 12:46:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 11548655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C0A6739 for ; Thu, 14 May 2020 12:46:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7A86020727 for ; Thu, 14 May 2020 12:46:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lpJxwSH2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A86020727 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Mxcmv+n0Z3Pb9m4gD1Q8Q5uzKATkP6HjW+twzADb87Q=; b=lpJxwSH2/o3GZgV0OFGV62dERN +s/xoW69mzD7QTUp8UjmvLsybIPLiWMnkG5rLj5w5ih94u7QZVSVpUiIlcG4Aid/cgsNh+hAqGFtm ngQ/uF0dkOc5Ep8nhGXcZmzP+8Gn0inAESX5owwUcW+Jh7NLHxMFlsP+UKieSehT2hPIyPF/bIZ5h 5sJwDEkpzEEGprl+f4bUF1trn7BOiOMoBBMfkKBRMMmLV8LySkk9ywc6S1Wh0bwH5Gjd0htrxdfXa crdDd9AgnrVJ2PmeRjBQo6JN6rwRnoJAgV8OlnD9cjpnXBacPKqL/S30b1HSXmjnqzUwvq5zIpiTG aQQDO0cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZDG4-0004Jk-3Q; Thu, 14 May 2020 12:46:40 +0000 Received: from 8bytes.org ([81.169.241.247] helo=theia.8bytes.org) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZDFs-0004AY-PW for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 12:46:30 +0000 Received: by theia.8bytes.org (Postfix, from userid 1000) id AD2E5273; Thu, 14 May 2020 14:46:22 +0200 (CEST) From: Joerg Roedel To: Maxime Ripard Subject: [PATCH 2/2] iommu/sun50i: Use __GFP_ZERO instead of memset() Date: Thu, 14 May 2020 14:46:21 +0200 Message-Id: <20200514124621.25999-2-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514124621.25999-1-joro@8bytes.org> References: <20200514124621.25999-1-joro@8bytes.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_054629_467812_C12E7B0E X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [81.169.241.247 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Joerg Roedel Allocate zeroed memory so there is no need to memset it to 0 in the driver. Cc: Maxime Ripard Signed-off-by: Joerg Roedel --- drivers/iommu/sun50i-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index a52f52eff7c8..9c763d4a8e2a 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -616,11 +616,10 @@ static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type) iommu_get_dma_cookie(&sun50i_domain->domain)) goto err_free_domain; - sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL, + sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(DT_SIZE)); if (!sun50i_domain->dt) goto err_put_cookie; - memset(sun50i_domain->dt, 0, DT_SIZE); refcount_set(&sun50i_domain->refcnt, 1);