Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4840826imj; Wed, 13 Feb 2019 01:56:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IY5akrVRtcvpBjykFRMQ99beToWLdUZFiKAfBCr54vmQWZts4I8r9Ja9vg9p1JI4UFetfgj X-Received: by 2002:a65:6242:: with SMTP id q2mr8139967pgv.245.1550051763725; Wed, 13 Feb 2019 01:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051763; cv=none; d=google.com; s=arc-20160816; b=pAkdv6atFPnfpeaVn68jJXgwrZ04OuenZi9hjSMz/xKF1i0oRTNnFneOZoYihuvb0w PiQV+fTUXOEVJ6/2OrMADqzFXgmugCt9DtDX6J7DU+RsSt+zFK9qh0OSE45o06bj+nii +KexyzKUwGxk1xqvizhK8+M8ulSE8NaHfJZRMF0ZYTlbDeyZyx843YnO4oSvBKExnnq+ d+JduUFTiD90aMkCjy7FWpuNvQlezOq46BOurnT99elGQvvArss7O43SrWHP9Ao218VD TTYNSuEk1inG0E5FBHTbXN0W8OXUvUtdQU7J8eOPUXqyKkEuhUDTaiSFuwa3ikeZprBy AFRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p2xakRDcJsV2sQPDu55ZX94FTycx/51cxKv4YN7tM6s=; b=OYN1i+S/QOef6L7gJ8iGEh3HizGBgnsDzmZ17l2TXbXIx+CTNuRnOTHHiz6vrxdvh1 sZbLba8D+UY6LAII4y9JSe6+7L9HcUFmT7NMKCTwxyRptENiGVvzgRVsVnuNMnYsnO60 3RiyYRNlpdz6kLwDDKU5g8IWNhhIAZT9uJ/6/ncXHiDCHVwYa8BHfI5tF6dU7vVPhh3I c460gY1nUivjPmUatB1x3o1+/GXOHe3jdahVZAkci2KKtfM5J31L5MsIyfyiOfjC2Tq8 uGuKsJ95WRwI8yHBFII0ChxLCftTXee2IXJ5Bh40MVJPMiqUZgV/FWD+/GW3Cmeh2AfS BpBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BuIzt3kF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si15259285plo.406.2019.02.13.01.55.48; Wed, 13 Feb 2019 01:56:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BuIzt3kF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389246AbfBMHDM (ORCPT + 99 others); Wed, 13 Feb 2019 02:03:12 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387679AbfBMHDL (ORCPT ); Wed, 13 Feb 2019 02:03:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p2xakRDcJsV2sQPDu55ZX94FTycx/51cxKv4YN7tM6s=; b=BuIzt3kFvV26v+ay2Odmf3LsFE JcUf8WZBpzfnJVIHFDTvpRZ+Ju3gJvHOYeODP97/UIMmleBSDntJEcYcEzce/fDctI/9Z32T4IS8I hDfmyVayFn43NfXlG3Q+TRsUOVlfl8Ry514/49L4PgietHURM5NMXEPZPBA/zUgptx5D8v1Q/KBqr c0FoPYAT9dHwHPhA0FyPF3MDhe2tjEy5ZmEGGgboykws93BGhJJ6tf132PmsTRTaUs40Z2l+qR0An TAf0JHybG6nSyugm3syFeZtbpC5R3M81S5vDGDoAM4kQNHCJzR++K7SCfyovgZ4zxJB8tlb80QH2t TGnasZ9Q==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtoZH-0000nP-Dw; Wed, 13 Feb 2019 07:02:51 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Olof Johansson Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Christian Zigotzky Subject: [PATCH 32/32] powerpc/dma: trim the fat from Date: Wed, 13 Feb 2019 08:01:33 +0100 Message-Id: <20190213070133.11259-33-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213070133.11259-1-hch@lst.de> References: <20190213070133.11259-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to provide anything but get_arch_dma_ops to . More the remaining declarations to and drop all the includes. Signed-off-by: Christoph Hellwig Tested-by: Christian Zigotzky --- arch/powerpc/include/asm/dma-mapping.h | 29 ------------------- arch/powerpc/include/asm/iommu.h | 10 +++++++ arch/powerpc/platforms/44x/ppc476.c | 1 + arch/powerpc/platforms/85xx/corenet_generic.c | 1 + arch/powerpc/platforms/85xx/qemu_e500.c | 1 + arch/powerpc/sysdev/fsl_pci.c | 1 + 6 files changed, 14 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index a59c42879194..565d6f74b189 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -1,37 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2004 IBM - * - * Implements the generic device dma API for powerpc. - * the pci and vio busses */ #ifndef _ASM_DMA_MAPPING_H #define _ASM_DMA_MAPPING_H -#ifdef __KERNEL__ - -#include -#include -/* need struct page definitions */ -#include -#include -#include -#include -#include - -static inline unsigned long device_to_mask(struct device *dev) -{ - if (dev->dma_mask && *dev->dma_mask) - return *dev->dma_mask; - /* Assume devices without mask can take 32 bit addresses */ - return 0xfffffffful; -} - -/* - * Available generic sets of operations - */ -#ifdef CONFIG_PPC64 -extern const struct dma_map_ops dma_iommu_ops; -#endif static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { @@ -43,5 +15,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) return NULL; } -#endif /* __KERNEL__ */ #endif /* _ASM_DMA_MAPPING_H */ diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index 6f00a892ebdf..0ac52392ed99 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h @@ -325,5 +325,15 @@ extern bool iommu_fixed_is_weak; #define iommu_fixed_is_weak false #endif +extern const struct dma_map_ops dma_iommu_ops; + +static inline unsigned long device_to_mask(struct device *dev) +{ + if (dev->dma_mask && *dev->dma_mask) + return *dev->dma_mask; + /* Assume devices without mask can take 32 bit addresses */ + return 0xfffffffful; +} + #endif /* __KERNEL__ */ #endif /* _ASM_IOMMU_H */ diff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c index e55933f9cd55..a5e61e5c16e2 100644 --- a/arch/powerpc/platforms/44x/ppc476.c +++ b/arch/powerpc/platforms/44x/ppc476.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c index 808da1e9c0a7..785e9641220d 100644 --- a/arch/powerpc/platforms/85xx/corenet_generic.c +++ b/arch/powerpc/platforms/85xx/corenet_generic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c index 27631c607f3d..c52c8f9e8385 100644 --- a/arch/powerpc/platforms/85xx/qemu_e500.c +++ b/arch/powerpc/platforms/85xx/qemu_e500.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "smp.h" diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index a04c6dde6ed0..f49aec251a5a 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include -- 2.20.1