Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1675130imm; Thu, 19 Jul 2018 06:06:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2L2CU9VEE/ByWBLeVLSDLipoB3GeGecPA5qJMDfgDHqFD5K9LyBNLBrNITiC7O5uGjoof X-Received: by 2002:a63:4386:: with SMTP id q128-v6mr9965778pga.353.1532005594231; Thu, 19 Jul 2018 06:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532005594; cv=none; d=google.com; s=arc-20160816; b=fCcW1Rwsh97hMbujSdeVI/lcQ3gr0h7KJxODkkNJMr12lUV+1B0xFo57oF0qibF0h8 Mtd1ugQvsstd3WzHKxOu/39umVCM+juqEgGMvv9IObHH9pYpdtZ+RR4YnhrlsGT/pgvj TrsUVu04fGzbJWlkHpZUaekZdmiMnEXNeziYQoOzR6dgOYO2p/sqmKziFXEO+63UD28t qfCV5/oqrCmjdgCkIr+PKkdLBIsTPjdfvvrSGUJD/2R9tza3t+MQw1+uzPq1P/KlJJfW Rrt+B1WfMZSe7vseyytxQfS4U23yAFj0F2c2+FDNGQs86bn+Jbzv7svX2emSvdFGzjfX 2/jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Niq8j26ItwVFgXTHUC0I9d2uex8M1FL6TCOOiCLuoRs=; b=by1Zf94tPs2Omcyff+y1powSeMPuztoJW8MgkJegfxr0SwoN0xVKI2PabSQVqxWIHK 8hBFci7J+pYD/2UL6fdMRH2cuSJAgtyUe5L5nvwnnSfJcgjG7fjuuSXCvn7wk3mBeto9 AIZHL8GSWdzhAlSegC+oYt9VPV+fXhlkf3PiAEtDVNQ69jx54cUhKIMM0jv09yuq0NOI 4txhnWFSAePmZ6EfDdS9IrpkwV/o1wJd5H7pbJHbuBYVNndO5UOzNnBTD0SgDHwpqkz+ QudQgRK6WOqORqKlbjVKtGxOqjhtoCOq1Dfyr/YCe9FnyWt0Wqy6v3yUbIxP6r5OmjB2 ji9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uYOTOKue; 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 n59-v6si5312342plb.198.2018.07.19.06.06.19; Thu, 19 Jul 2018 06:06:34 -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=uYOTOKue; 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 S1731775AbeGSNse (ORCPT + 99 others); Thu, 19 Jul 2018 09:48:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38854 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731645AbeGSNsd (ORCPT ); Thu, 19 Jul 2018 09:48:33 -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=Niq8j26ItwVFgXTHUC0I9d2uex8M1FL6TCOOiCLuoRs=; b=uYOTOKue9ilP/Y8IPj+AKe2nT OpRN68pEaY+mhMf+xOVUDgHd9egq6LAItD9PI19uQRVfzRnYC4keI08faLGtzkcI54eajcSQUQ1Ym 8dZKgqvvMHmlQs4kHJiUADJu4MNm/FeXS69JR4S7TEeVKWomy1TFetXOvTouu8argrTmjxGRJpN30 1E4ioQ9GtjdiTxHCJQVFWtLOvcIE7d07ykPteNeIG8swWX+gFoQ/Dz2EaLqApASgPTUZ56DtuqO7T 2KM6IEDQQopYALKD9BZszr8YFlIJU9a5EkiB5hmzXNGkuTTxtpauIo53qrw7w+oSfrFNGl9O0NHSh FCjx4vtug==; Received: from [96.72.186.57] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fg8cP-0001gC-EB; Thu, 19 Jul 2018 13:05:17 +0000 From: Christoph Hellwig To: Yoshinori Sato , Rich Felker Cc: Jacopo Mondi , Thomas Petazzoni , linux-sh@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] sh: simplify get_arch_dma_ops Date: Thu, 19 Jul 2018 06:05:12 -0700 Message-Id: <20180719130516.1989-2-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180719130516.1989-1-hch@lst.de> References: <20180719130516.1989-1-hch@lst.de> 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 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 3e3a32fc676e..79a9edafa5b0 100644 --- a/arch/sh/kernel/dma-nommu.c +++ b/arch/sh/kernel/dma-nommu.c @@ -79,10 +79,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 fceb2adfcac7..e9d422bd42a5 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 4034035fbede..7713c084d040 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -339,22 +339,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.18.0