Received: by 10.192.165.148 with SMTP id m20csp415181imm; Fri, 20 Apr 2018 01:11:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/fLqcejcuwNBAfZxwxVfdiDT8Ospzx2vS6tfz/bTsBKgmrzCQ4ZX0cy+BwtklJI3PePuV5 X-Received: by 10.101.64.8 with SMTP id f8mr7750913pgp.31.1524211871260; Fri, 20 Apr 2018 01:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524211871; cv=none; d=google.com; s=arc-20160816; b=RWicXhig743maugmkj7PLL3Tso5UTEefw2vqwUitVnUjCkbAstByhgbRaQdEeX7UWB 3LVkvyqya3zgcLlKdtJ7GCgzy4zG/ZcNsJjn6N38qYZwrFE87tNCDslO+rO6xcX6ev6P aZYR/JLlzHh/PSqUPNLzvyTwlbPk7vCGjvoPiBmf5LNsQbt9OC4gyFQCokFvtrFZr205 4pqtrrReL4QVSq1smUetUhX2BRqXkSIwzcpRi5/5V2bc9ENpzOQTLMOGHxK3fJokCg23 BBjNHLo8SJoh+Pw4ozWwbmbcSrsP6SpYF8TyAVUogWrkhNbkJq1Q39QyrvgwzjmQarOv lOhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=aRSaiFbfkDN2P8FpPK1+g0zgH09rNBpip3xqDpzOkYg=; b=mVCnnrwgVA+LocFWkCU7uH+dUem1puz2+FvICBVz7OHe2Bnp4Ek7hugmmGObn6yVGO IMfYaF0dC70pj5TunSYwNnKEPUq7Z4LSBwG2Jklxq3RYV62NzjTvR0N8evBByu40jMSk GhA8x3uZGU6TKvi2PBHdUu9KV8LsaDJ4rGx3xLODIPlAYk//I2djr6zMU2k2U6Th+oI7 236KJ2HuqHhWRObWLrUZEL9vCw25v4Mg0lSDG0GtkFIQOQTxjk67YGbFIWykjwyb5gji UPiBuZdRBNJsF3u1OQtahBsqdG6rMX66gplURQTRSaIP0z6FvIg0Xi+Q7yPVKScCPmSF z8nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EqJzqsQd; 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 f15si4496384pgr.138.2018.04.20.01.10.57; Fri, 20 Apr 2018 01:11:11 -0700 (PDT) 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=EqJzqsQd; 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 S1754327AbeDTIEu (ORCPT + 99 others); Fri, 20 Apr 2018 04:04:50 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40614 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754277AbeDTIEq (ORCPT ); Fri, 20 Apr 2018 04:04:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=aRSaiFbfkDN2P8FpPK1+g0zgH09rNBpip3xqDpzOkYg=; b=EqJzqsQds7onihtHbGOczl8G/ ntWDbBem4C84QDGlfoo57aGF9tKPOJNc7npCXCtvy1K0M7whD3vagZf9R4XZnfTPfyWpFeCY4DU46 1+53Rc7f4lq/SPLqeIZb9mK/oQW+lS2I2NWxZdmmRnteJS0358JL1/4dodd+ZI+90e6ITRmssA98K aZiU6qVSfcb0p9lnTBa/A6QD2wMB8irQmgRXDN+Pz0VvIY554K3iqtl6FMpsavBEVPJOEaKK5CpNC 69NkCB0/v8U2CHtKey8BsLQITlVaw60LDM1lahhBFGVFB0tNZbN06Q99biPG+m24mon/MEKFjs9Uf dJBpYacow==; Received: from static-242-42-24-46.ipcom.comunitel.net ([46.24.42.242] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9R1g-0007iF-BB; Fri, 20 Apr 2018 08:04:13 +0000 From: Christoph Hellwig Cc: linux-arch@vger.kernel.org, Michal Simek , Greentime Hu , Vincent Chen , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/22] sh: simplify get_arch_dma_ops Date: Fri, 20 Apr 2018 10:03:07 +0200 Message-Id: <20180420080313.18796-17-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420080313.18796-1-hch@lst.de> References: <20180420080313.18796-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the indirection through the dma_ops variable, and just return nommu_dma_ops directly from get_arch_dma_ops. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/dma-mapping.h | 5 ++--- arch/sh/kernel/dma-nommu.c | 8 +------- arch/sh/mm/consistent.c | 3 --- arch/sh/mm/init.c | 10 ---------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 41167931e5d9..149e71f95be7 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h @@ -2,12 +2,11 @@ #ifndef __ASM_SH_DMA_MAPPING_H #define __ASM_SH_DMA_MAPPING_H -extern const struct dma_map_ops *dma_ops; -extern void no_iommu_init(void); +extern const struct dma_map_ops nommu_dma_ops; static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { - return dma_ops; + return &nommu_dma_ops; } extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c index 2077cfe73cc6..c0fff676e2e4 100644 --- a/arch/sh/kernel/dma-nommu.c +++ b/arch/sh/kernel/dma-nommu.c @@ -76,10 +76,4 @@ const struct dma_map_ops nommu_dma_ops = { .sync_sg_for_device = nommu_sync_sg_for_device, #endif }; - -void __init no_iommu_init(void) -{ - if (dma_ops) - return; - dma_ops = &nommu_dma_ops; -} +EXPORT_SYMBOL(nommu_dma_ops); diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index a7bff3f29c2b..af2f28572119 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c @@ -20,9 +20,6 @@ #include #include -const struct dma_map_ops *dma_ops; -EXPORT_SYMBOL(dma_ops); - void *dma_generic_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs) diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index ce0bbaa7e404..32e09f03e6bf 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -395,22 +395,12 @@ void __init paging_init(void) free_area_init_nodes(max_zone_pfns); } -/* - * Early initialization for any I/O MMUs we might have. - */ -static void __init iommu_init(void) -{ - no_iommu_init(); -} - unsigned int mem_init_done = 0; void __init mem_init(void) { pg_data_t *pgdat; - iommu_init(); - high_memory = NULL; for_each_online_pgdat(pgdat) high_memory = max_t(void *, high_memory, -- 2.17.0