From patchwork Thu Jul 6 15:45:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13303976 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 489D5EB64D9 for ; Thu, 6 Jul 2023 15:48:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D4F408D0008; Thu, 6 Jul 2023 11:48:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFED48D0003; Thu, 6 Jul 2023 11:48:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC7428D0008; Thu, 6 Jul 2023 11:48:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A94FD8D0003 for ; Thu, 6 Jul 2023 11:48:40 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 84082AF7D2 for ; Thu, 6 Jul 2023 15:48:40 +0000 (UTC) X-FDA: 80981619600.13.3E15770 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 5341040020 for ; Thu, 6 Jul 2023 15:48:38 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Kth/OuK7"; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688658518; 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=keQ78Mv/VCFMjxLJbgEgr2h/sjN0UpPUn6QsvR3JRNU=; b=xwwsi2Ab1vFmvrd0KPsPv5vXpQDlt5gFZUJZ1XLBwxBm7AhZ1AqI0rXrmgMsoggYmsFGUi 54tTSeQB7+iLX+kPihEarT/C2dI9OaVpvqCFvxS+nNHYW3X2+J7czqc4C0EC/jH8Ugn8zc BjW8L04Bw3mKMwbvzMwryGl5vPYuf+g= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688658518; a=rsa-sha256; cv=none; b=bRO1CxoN2E7QXRzc5xIM3VQM3UIK5K+HWN7rRZihc+gV/ED4QtchJdKn5nDWuyfCeNUiTV 6fnM9dFAp+gNj/Stgcy6Lk7WJgeybtOJ9ARl3YtNLpVYY5H5tLbIAQuVGw3vSgfWIQPsvx Jo0hI4beNpIDFSva6B3JViK0+Agq0z8= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Kth/OuK7"; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688658517; 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=keQ78Mv/VCFMjxLJbgEgr2h/sjN0UpPUn6QsvR3JRNU=; b=Kth/OuK78uGnurgU1c2bKZQ1fDCD0Q8atuGqGCb5Dba8YkuimcjONwVw8hYie6A2ifubyR 2heu5aKmPDbaqX+v/jEzocktOyzrmqFdKumUQ/aD49P2q2FfU/yvmBevV8JUruF2m49tOX fwQeO2gXGgBD9J2b3QywL69y1m5+n1I= 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-592-vcwacN9DPj2Dhag0q5VkVA-1; Thu, 06 Jul 2023 11:48:34 -0400 X-MC-Unique: vcwacN9DPj2Dhag0q5VkVA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0BBB9881B27; Thu, 6 Jul 2023 15:48:33 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42160F5CF0; Thu, 6 Jul 2023 15:48:24 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, linux-mm@kvack.org, arnd@arndb.de, hch@lst.de, christophe.leroy@csgroup.eu, rppt@kernel.org, willy@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, shorne@gmail.com, David.Laight@ACULAB.COM, deller@gmx.de, nathan@kernel.org, glaubitz@physik.fu-berlin.de, Baoquan He Subject: [PATCH v8 19/19] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Thu, 6 Jul 2023 23:45:20 +0800 Message-Id: <20230706154520.11257-20-bhe@redhat.com> In-Reply-To: <20230706154520.11257-1-bhe@redhat.com> References: <20230706154520.11257-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Stat-Signature: 7p1x1cjs38zs8sq795kckn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XCBEuj1sC/AYRn92NHPnm0xDIXxAQNE2cK+o0EiZZY6T8SLhPmJsN5XkX1vi8rY3pMSxSHAblsvGXjrrrrQ0qnLByI+ar3UPT9VMtDsVaL+RsAGZnfBnKM06+mJLmXKoJDkkCXc+TYPXOq/YOuLYqsaZ5UwF73+leDX0h0V40HDLukEffRzfu/lYIkQqQTHLZA2MhANZp7ZIz2LxqV+GFGAzJaAwmzqaIIJk8K133H+md4RGfP3bWsejOsH4R7NI2pLrhdeXDmMQ0mCgwyoZ47UlZzAm5Pqb6upquHcwjI= 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 Reviewed-by: Christoph Hellwig Reviewed-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) --- 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 39244c3ee797..bac63e874c7b 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 a21a6c9fa5ab..3e049dfb28bd 100644 --- a/mm/ioremap.c +++ b/mm/ioremap.c @@ -33,9 +33,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; - area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START, IOREMAP_END, __builtin_return_address(0)); if (!area) @@ -64,9 +61,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); }