Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6888755imm; Tue, 24 Jul 2018 05:03:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeMXGl6LL5SQag2TVWqqPEnbEGz0JijWA/WZX3Oj2q3ytMBRBukEDxZ/faby/wvDHhZMEl7 X-Received: by 2002:a62:4ece:: with SMTP id c197-v6mr6623050pfb.240.1532433800446; Tue, 24 Jul 2018 05:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532433800; cv=none; d=google.com; s=arc-20160816; b=fOrd+BqBcD4NXhKOUfaHJyz1vHMDbyz83SCPLkNplN6m9CgHeyCmo4XCxo2Xc2PXkx Rj29TjcsPMWvU3M2+NqWjCou7c1BeXK9XQn7WaDgGAIMi0k9acowJ4ybCVG36j+XApO6 UWJMxXveAutdK+Qs2XcCjcShkkoyQSPRmcAZRAJtVmZPIDk/J7zDLMOu1gDRKD3y2TVN pDtat6bz5cVRi6wZ5I9sl87bPt5kvK0aqUzmSC3xzHUx4b3ypXRQY64vKHQqyRbB3iJG xzu9JU/N9fO/gJ1vQvaB7xejj6gmMp9bg/yFOis7R7NZv75E99LcFJtGlQBXeG259VdD sWMw== 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=ijjaG1dB6i19hp6DXgxC2voM5BFll6c19/IOAv1rH8070dCtilcT0qVl0lPaHphw25 ezsyPvUn6pWEGsTV4iL1h0kpqrjrSrpuHtFsBCIJimitRajib2409T3VHWTZqa1XtA1A vnHa3niZOg/4dgsAdqj1UKl9fwezbFXUMMo/RkZD9YuLzKTB6nRdB+U1GK/xtItTEtel cHOsAV+BLpKWQEePrzaHeDkaHq6IW/AyjNnLjJCQtK9qqijxn24FkKmSohQuuVaAY2/R F/wi3hdtd5BZR8fCkRMJH28BnSuo9kw1PN2NMgS99RRdlfEJiV1He8I2e69X9JEmTS0L x7kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=b2gO89mT; 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 c16-v6si10063672pgw.460.2018.07.24.05.03.04; Tue, 24 Jul 2018 05:03:20 -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=b2gO89mT; 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 S2388495AbeGXNIH (ORCPT + 99 others); Tue, 24 Jul 2018 09:08:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54954 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388477AbeGXNIG (ORCPT ); Tue, 24 Jul 2018 09:08:06 -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=b2gO89mTgsQK+OIO/+v3dDBH/ oPYdQVkLYItNEMQaq4hx26a+brz44QawurPhWu9GMBQ3XexanXlMo9yj6c/CLPyR1/TH2Q4dmvuKW Aj9wnYK/5YzOcVecI03uOzpU9FyyI5nZD+aD71l1aduw5xFIZRovXKLvdTm63T0U6OtvnOT5BNbOe IA4rITCqeRV2q+uzi1fNjUOzaViuNi9WLpFST7DD0BFiJrdJE+MOKgWA6acH2fX79/q1Fmj+SFITi LrlEu5mZ2+aCVmD5c/r/1ewgP3AKIknfo69t8kbIqF1z1BN2l891HEFX6AhK9gzWe30Nm1Be3zMjn llXMKWmdg==; Received: from 089144194224.atnat0003.highway.a1.net ([89.144.194.224] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhw0n-0001Vb-4I; Tue, 24 Jul 2018 12:01:53 +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: Tue, 24 Jul 2018 14:01:43 +0200 Message-Id: <20180724120147.15096-2-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724120147.15096-1-hch@lst.de> References: <20180724120147.15096-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