From patchwork Thu Feb 16 12:34:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13143042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 938ABC636D6 for ; Thu, 16 Feb 2023 12:36:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A32A6B0083; Thu, 16 Feb 2023 07:36:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 353DC6B0089; Thu, 16 Feb 2023 07:36:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21BBA6B008A; Thu, 16 Feb 2023 07:36:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 110C26B0083 for ; Thu, 16 Feb 2023 07:36:43 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DA2651A1067 for ; Thu, 16 Feb 2023 12:36:42 +0000 (UTC) X-FDA: 80473103844.28.3CA9BBB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 21F4A160003 for ; Thu, 16 Feb 2023 12:36:40 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HanqESI8; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676551001; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sZjhNHfCq0k8rI1ELCJTN8u4w8f61XUm94YTHptLe20=; b=PCT7O9OEVILLKbf8WD49SeL9rZoVy2/NbhtjBeEfrECzFoKcvHNxdPoFxEAE29NsFQIi4x V5foInsKcKqA/u4uMJ33hhttwuA+to0Rs1lBqcn2UqLZoeuaSeZP9TBmtisppg2NJeEy2E ZEURaAQim1wEgwfb+EmACSPK0HdOyy8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HanqESI8; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676551001; a=rsa-sha256; cv=none; b=VY6sz/9jnwAhdlCYy+cOriR6vivR24hQ30+iIq6L/ZcQ7Hw81o6APXn2iRJgmMFsN9pz35 gj6Yg5dmRhDAabfBNyX2tArMWs2kxyZ3Sf582z62sVsD4/6q2WDdZ6AAr3DXrqfGi1QsnD wAS+aFgvOOVFwX0NuJUayVxTN5d/nLI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676551000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sZjhNHfCq0k8rI1ELCJTN8u4w8f61XUm94YTHptLe20=; b=HanqESI8GhbZ3S4axeXtCXJGFgVWde698u5t9epuR0sgrWqgcd9Vmwyzye3XcwHk8p/9A1 kqNAbVk7iMFNSwQIZshk7W6blfZEilXCp3CUEbJN9LGQIHpoo6hep6IYn0jOqoJAaFw9HX JoRy2PwX3Oy+Crq2Nh99t3+V79JfpBI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-kAAWe3RXPKal2kOmpWdx2A-1; Thu, 16 Feb 2023 07:36:37 -0500 X-MC-Unique: kAAWe3RXPKal2kOmpWdx2A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AEB7F85CCE0; Thu, 16 Feb 2023 12:36:36 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-99.pek2.redhat.com [10.72.12.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37CFE492C3C; Thu, 16 Feb 2023 12:36:22 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, christophe.leroy@csgroup.eu, hch@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, arnd@arndb.de, Baoquan He Subject: [PATCH v4 16/16] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Thu, 16 Feb 2023 20:34:19 +0800 Message-Id: <20230216123419.461016-17-bhe@redhat.com> In-Reply-To: <20230216123419.461016-1-bhe@redhat.com> References: <20230216123419.461016-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspamd-Queue-Id: 21F4A160003 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: c4etobnwtkti7n18zibd993pejgbc48p X-HE-Tag: 1676551000-337837 X-H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qKoJTbLH15hKROa9QDhrLZVrGeM70p0kpswyeE7atJTwP5W9O5CE1/OflCW7GLx3FjEJ3BgBcma7J8PKQTkXglTbHKfUYeIpLmzAUuOOZVA4PWTfWmc8pCrKGCkmk3ZghKDLJcAJMk9ZqsshWLV8iXCHVZ4CZA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now there are no users of ioremap_allowed and iounmap_allowed, clean them up. Signed-off-by: Baoquan He --- include/asm-generic/io.h | 26 -------------------------- mm/ioremap.c | 6 ------ 2 files changed, 32 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 29ee791164ac..c13109d17dcb 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -1047,32 +1047,6 @@ static inline void iounmap(volatile void __iomem *addr) #elif defined(CONFIG_GENERIC_IOREMAP) #include -/* - * Arch code can implement the following two hooks when using GENERIC_IOREMAP - * ioremap_allowed() return a bool, - * - true means continue to remap - * - false means skip remap and return directly - * iounmap_allowed() return a bool, - * - true means continue to vunmap - * - false means skip vunmap and return directly - */ -#ifndef ioremap_allowed -#define ioremap_allowed ioremap_allowed -static inline bool ioremap_allowed(phys_addr_t phys_addr, size_t size, - unsigned long prot) -{ - return true; -} -#endif - -#ifndef iounmap_allowed -#define iounmap_allowed iounmap_allowed -static inline bool iounmap_allowed(void *addr) -{ - return true; -} -#endif - void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, pgprot_t prot); diff --git a/mm/ioremap.c b/mm/ioremap.c index 4a7749d85044..8cb337446bba 100644 --- a/mm/ioremap.c +++ b/mm/ioremap.c @@ -32,9 +32,6 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, phys_addr -= offset; size = PAGE_ALIGN(size + offset); - if (!ioremap_allowed(phys_addr, size, pgprot_val(prot))) - return NULL; - #ifdef IOREMAP_START area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START, IOREMAP_END, __builtin_return_address(0)); @@ -68,9 +65,6 @@ void generic_iounmap(volatile void __iomem *addr) { void *vaddr = (void *)((unsigned long)addr & PAGE_MASK); - if (!iounmap_allowed(vaddr)) - return; - if (is_ioremap_addr(vaddr)) vunmap(vaddr); }