Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5012970ybb; Tue, 24 Mar 2020 09:20:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPWfO8HD1RLhAyjnObUK6Wo9y2qSAx4hsoq1CsUAAEN/nUsKk0Y5uXzC5Hz/RoHoTkG/d2 X-Received: by 2002:a9d:7317:: with SMTP id e23mr13271544otk.202.1585066842167; Tue, 24 Mar 2020 09:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585066842; cv=none; d=google.com; s=arc-20160816; b=jmPVpC4eDq3IQgKDUeAXsTWGWTNQEsxf6rkRGJg9lMHFGvtlQ0Anoy2b/y4DU+6rdn vWQCJLRQrnfmSJCEzSbzOohiv1YBL6o1J/wr0plOwZ7UHPMVATVP4mF5hZKzMq3mubyg n1P1RFDtFFTMM6Fv5edWxkIqyUBuUS/BpC1QhiL8nlqn/4r876JvxUjTFyr7SOkA+NzD fzMCX+1pyMY8oZIh5V463gWpGxR2psz7lupnFnuJeX24wpAjWbakL2Jfy+ocX8C47Z37 TrhmNEfKcU9efB11Rrqx2zzTzh1ClojpL1D037ZSZrzzZZJiZGmFDwDicbdTs/PWmMx8 jzFA== 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=hWBzE7+Ma89SOv/SxY3UdWgMQO5IxVxE22FLaZEKh/I=; b=dYQ3miePcRw2cSNEKbcfMFxMedkyPGCuEycaGSWj3F4xOn3u3BE86IeWHk/4qkmOYJ 0nmOIfw18KCf9SaM1tyJ+Vhniw9NpuRfyLjVhYGiXRyQ+fkXRFpz2F4H9PoEAgvFxIly udVk5g11nayTU3Z8JrsxQEoGxI3F1X8agRfT3EqJ/semL+LahLAf89/VmGanF83pCKPC 0gMKQS97CHBL9Ftvr7S8Yf/yfdgbWZ5+SD+t2gfSZZ2SPWZ6A+PaH9LWkhCtk+WhAoEh QRxIB0L5L0rBltS06Yh6R6RXUDuwpZVpMwXkVVX7VyCJyDlC+z6WuMfuPG2oUkH2UP8z P0rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=L33QL+FC; 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 m193si8854658oig.77.2020.03.24.09.20.28; Tue, 24 Mar 2020 09:20:42 -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=L33QL+FC; 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 S1728769AbgCXQT5 (ORCPT + 99 others); Tue, 24 Mar 2020 12:19:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55478 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727688AbgCXQT5 (ORCPT ); Tue, 24 Mar 2020 12:19:57 -0400 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; bh=hWBzE7+Ma89SOv/SxY3UdWgMQO5IxVxE22FLaZEKh/I=; b=L33QL+FC6OUtXe/Qh46Prloa5b lLkZ6Ka3AxwHJu22+ZmBfRkwiKA6Cz8EJJzIvTqIQnwXHBHKb+J/gzj7DILgquMOgdhJuMbEu0UBh DzczfY2x82db+KHQ2P82uOBjljl1KlHb7hUi8U2lO12oH/GwWRZSpOleZzm8EpWFH4qe/6pSPzl6O 0IyWoemmFV2lFqm9lS2IrNc1Bsqqr0mOtn3zBvM52/Xy4nC66wks2vGQzyQ5X6Vj000HzbYjtaDdi jd5YaXNSgE35IIRa6y4WL4c0QEwN1BZEtwWxv2LLxFufeIrAWLiepC4XPVRThZDq9lHZCxDsBYKco SuicTaWQ==; Received: from [2001:4bb8:18c:2a9e:999c:283e:b14a:9189] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGmHU-0003Ft-EK; Tue, 24 Mar 2020 16:19:56 +0000 From: Christoph Hellwig To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] MIPS: merge __ioremap_mode into ioremap_prot Date: Tue, 24 Mar 2020 17:15:22 +0100 Message-Id: <20200324161525.754181-4-hch@lst.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324161525.754181-1-hch@lst.de> References: <20200324161525.754181-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 reason to have two ioremap with flags interfaces. Merge the historic mips __ioremap_mode into ioremap_prot which is a generic kernel interface. Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/io.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 7be323ed2bfd..60513250f8f8 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -156,9 +156,17 @@ static inline void *isa_bus_to_virt(unsigned long address) extern void __iomem * __ioremap(phys_addr_t offset, phys_addr_t size, unsigned long flags); extern void __iounmap(const volatile void __iomem *addr); -static inline void __iomem * __ioremap_mode(phys_addr_t offset, unsigned long size, - unsigned long flags) +/* + * ioremap_prot - map bus memory into CPU space + * @offset: bus address of the memory + * @size: size of the resource to map + + * ioremap_prot gives the caller control over cache coherency attributes (CCA) + */ +static inline void __iomem *ioremap_prot(phys_addr_t offset, + unsigned long size, unsigned long prot_val) { + unsigned long flags = prot_val & _CACHE_MASK; void __iomem *addr = plat_ioremap(offset, size, flags); if (addr) @@ -202,18 +210,6 @@ static inline void __iomem * __ioremap_mode(phys_addr_t offset, unsigned long si #undef __IS_LOW512 } -/* - * ioremap_prot - map bus memory into CPU space - * @offset: bus address of the memory - * @size: size of the resource to map - - * ioremap_prot gives the caller control over cache coherency attributes (CCA) - */ -static inline void __iomem *ioremap_prot(phys_addr_t offset, - unsigned long size, unsigned long prot_val) { - return __ioremap_mode(offset, size, prot_val & _CACHE_MASK); -} - /* * ioremap - map bus memory into CPU space * @offset: bus address of the memory @@ -226,7 +222,7 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, * address. */ #define ioremap(offset, size) \ - __ioremap_mode((offset), (size), _CACHE_UNCACHED) + ioremap_prot((offset), (size), _CACHE_UNCACHED) #define ioremap_uc ioremap /* @@ -245,7 +241,7 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, * memory-like regions on I/O busses. */ #define ioremap_cache(offset, size) \ - __ioremap_mode((offset), (size), _page_cachable_default) + ioremap_prot((offset), (size), _page_cachable_default) /* * ioremap_wc - map bus memory into CPU space @@ -266,7 +262,7 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, * _CACHE_UNCACHED option (see cpu_probe() method). */ #define ioremap_wc(offset, size) \ - __ioremap_mode((offset), (size), boot_cpu_data.writecombine) + ioremap_prot((offset), (size), boot_cpu_data.writecombine) static inline void iounmap(const volatile void __iomem *addr) { -- 2.25.1