From patchwork Tue Jun 20 13:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13285845 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 6D796EB64DB for ; Tue, 20 Jun 2023 13:18:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 097D98D000A; Tue, 20 Jun 2023 09:18:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 047D48D0005; Tue, 20 Jun 2023 09:18:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E79048D000A; Tue, 20 Jun 2023 09:18:07 -0400 (EDT) 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 D814E8D0005 for ; Tue, 20 Jun 2023 09:18:07 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8B3E980F18 for ; Tue, 20 Jun 2023 13:18:07 +0000 (UTC) X-FDA: 80923179414.11.31D2EE2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 93AFA1C0014 for ; Tue, 20 Jun 2023 13:18:05 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DOa+i9+x; spf=pass (imf21.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=1687267085; 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=Hx/6/HkkGfsNOsUsc17L1A1zUHxCKxvj5QY17YrOx2vMAakOmVeOYeQprWOC1Tv9N2+3qQ rL7A+GKunaIiHYjbwKkDdfKOWqwkKM9YUFfCTrdytd0KU/+PnFuX+3MejRqOuFpzZAqkE6 YKhBNkJ4MhjjHd3M0XbCiOpV6wrLj2Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687267085; a=rsa-sha256; cv=none; b=DN/QpNEV/O+eGD7JbtlGXp2vCEAsknti86+KbYKn+L0rdpUvelqW7ApZfMg2Kt7ESIG9xW DfB9oiHWVw8Nyukzw/JEZ5TRmrGhJWvCa1QxZ8ipwswOJUhtu0zGbYnDXymw22ga1aTVpI kTWolmJxD/iQDfNSdKT76U19iNUMSus= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DOa+i9+x; spf=pass (imf21.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=1687267084; 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=DOa+i9+xnjer9WRb/ZpT5TWcsrrAKX/+7wi2BIJ0hSk75/0RM4VaceKHLFL/0AtW5UEp8F y1zvV8Rhpfxai8TI+H079mhqkG6jl15PyiDD58oxM+hLil05VXJKEADhmGYf1cKEc+pyLR nkCpt4FZCsdLxCXg7i3GQ5VkP/xYdaY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-168-10jviPZINQmT4T6apGJu0w-1; Tue, 20 Jun 2023 09:17:55 -0400 X-MC-Unique: 10jviPZINQmT4T6apGJu0w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 934BC3C0F691; Tue, 20 Jun 2023 13:17:10 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-166.pek2.redhat.com [10.72.12.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA753C478C7; Tue, 20 Jun 2023 13:17:02 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.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, David.Laight@ACULAB.COM, shorne@gmail.com, deller@gmx.de, nathan@kernel.org, glaubitz@physik.fu-berlin.de, Baoquan He Subject: [PATCH v7 19/19] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Tue, 20 Jun 2023 21:13:56 +0800 Message-Id: <20230620131356.25440-20-bhe@redhat.com> In-Reply-To: <20230620131356.25440-1-bhe@redhat.com> References: <20230620131356.25440-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspamd-Queue-Id: 93AFA1C0014 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: yz7syfhety9by1otijf61sty3jjci3og X-HE-Tag: 1687267085-656160 X-HE-Meta: U2FsdGVkX1+1n5O9tXbe3qRsxCF93lBmm9DcUf8hmEqiivYvvvz6ECcrxIm0YqjSXkRlWQG6CDALVbER0Nw4Jd9cVgcDyYJ7cSvjOYAWxkVCTiHDSS1/ejj1kP7HDpr9G32M2y9uzR/uMZy+o59vCjc8O4T8BlEqaYBcFKCx2hLi2hhsPbUAet7E+MvOwTicw2VCaI2HTI7Y8JtoU2d4YhGkb6aBz24W9WWaVndY610WJ4bNVHQZFGf+/pI2UuP18DxQGOHvS2kFg17WKS9raedmmtVpFhXx+aAbycDtdMSoOPR444TFej5mdK4Sx14p7JYNU9O6ppgNVYmFIxVcfP2em1XrjUe6V3DUm2ET+NROkyBV1gH1N2kAn0XGsTCmh83cDde7eovQOPZEFZ8xWrwoUvAWqKkcsTAC5QU0+er8Ft85m0+jVB/H8q3FqiutdFNa2YeUVjcyW8v295QjneCBeUgObFXRa4nC9NZjcvdjlnlXPXUTWVc48IzUwvBtfxctKQwkwJkI63xOBH8p+qS3Jp4QpwLWkgzEp82spBFhDW1koNknF2njgZQ2J9icl6YhJnlGF/VOj7joQsD0e2c4LJ4Q4nvPj/iBlWixJsuu/R6hogVXXeMtuKwL4MQEMs52kZERPK2HEZyl/5lORtl05iByVsp2VT087F+WvLeqLnY3YjyJKE7at/BC5+5cIgGlz9e3d5rMYJYO9ocEemlWOvuJnFumnHrmqhfWPEj1SYsAQzuquG6Bpt/Ogc/McCUxFzU8MvXpl3regmScuQ9GuiL1bh5SuCkl1wxO35USEB7sgULE6qKO9zLae5FUQcwyC+3FN2qOo+JvnM8radMIJ6Se9UAeUYGwmJJDRuX7qV5q73IRYG9R5sBSVV6JDkj6fslDgpqz0FcfP6VhSRX5A/JSjX6jLxpps7MUyG1WALXUlf980QCISuP++GPxrwdomQsQHTPc+1AjQpu GgWMZwGK zwBtOVZcUYR85QlokjFv/iMIs7lB7B5Pe6vUnFN3Nyq1bYMPFWHbCKvCTM7aIu5H8Xg5cbVPi1eDY/y+WNhJ3xzBCr0drEtMXNBv6GKFQGl6qPGTVi5dLT8XF7Kv3WwRDTDqNyDskBs23WqhdPooa6ZYcnC8sDmsCGqlHtfQvH5t2qEODs43bBMl2BbGWoN9UGLMWeqSa6fPnFzCA2jmq3SmAhXqpVVqnys2cYtAYpFPfLDmhZVYcLtzMSW8LPETeXFBoEaBcBDdRGjYlkizjE4P3soluSSqyqmXyGjSjoqSpV9I= 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); }