From patchwork Mon May 15 09:08:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13240998 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 C711CC7EE22 for ; Mon, 15 May 2023 09:11:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6657990000A; Mon, 15 May 2023 05:11:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6150B900002; Mon, 15 May 2023 05:11:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DCED90000A; Mon, 15 May 2023 05:11:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3BF7B900002 for ; Mon, 15 May 2023 05:11:23 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0E1D141159 for ; Mon, 15 May 2023 09:11:23 +0000 (UTC) X-FDA: 80791920846.13.A8098C8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 364A4160018 for ; Mon, 15 May 2023 09:11:20 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gW9b0JNy; spf=pass (imf08.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=1684141881; 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=Sk5VOSJIfD7nFCF0xkyXJ4tPwauxuD4OFust9+6yntw=; b=vd2DNvFOHcLKD91Wq/9uJojwj6u+IKzglca3oJM4/vYm94pSDcrk/VNG5mrgb3J/5eIhuR QUN/YRoK23QvtVuZLvMqF5L6SDHxq1lkC+69gPpuunB87wQAt53YXqg9/kb9nkjHdm4Lch oSkP+xmRr/ACHrMbirEeU8hO9VZpLM0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684141881; a=rsa-sha256; cv=none; b=OMB8CWLsO4xOhAsB1s/V2HDG5GwR7LVKQTlbFsh9z6dB5tJRJ177w0mDJl4rF+KA4n6PD2 SDMCouxEOKaBcgpyX2W90r9HRc35mrLQPXgik2Sy3OjMBeiqzz9HlzngccaesANGbstcx7 p5+n+Qh+PJRigN4jmV8WtOWM8+1/qho= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gW9b0JNy; spf=pass (imf08.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=1684141880; 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=Sk5VOSJIfD7nFCF0xkyXJ4tPwauxuD4OFust9+6yntw=; b=gW9b0JNy69jhOGf4SMpAGEnShVZ1UoAHYXPjT07THkP0MS/gc8F6Wx2n55gm1LRXluqvMK yDoNdhIyF68A+Lg2hpycTaQ3hwJkpmbK9Ch2rq4e8aRdC1XDGNpyCfpRY8w5zF8MS2uxvp Da+XxnxGi6wCeloLlRiLmfFrgAhcwgc= 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-670-4nGHS227OHuEF4ZCDKqsZQ-1; Mon, 15 May 2023 05:11:15 -0400 X-MC-Unique: 4nGHS227OHuEF4ZCDKqsZQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A63B88B767; Mon, 15 May 2023 09:11:13 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id E537940C2063; Mon, 15 May 2023 09:11:06 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, 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, willy@infradead.org, deller@gmx.de, Baoquan He Subject: [PATCH v5 RESEND 17/17] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Mon, 15 May 2023 17:08:48 +0800 Message-Id: <20230515090848.833045-18-bhe@redhat.com> In-Reply-To: <20230515090848.833045-1-bhe@redhat.com> References: <20230515090848.833045-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Stat-Signature: 7qad6nkxmg4x7dzn3e9massz35jd3t9w X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 364A4160018 X-Rspam-User: X-HE-Tag: 1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FlnO8gdz/ov9Q5pKJprFdyRpWL3/auJZeF3a+XPMk1JuqkqnIUUeFP7bNA7jWucnESgd+Rl0es/USPV/2pLlGKIyObMDBd6vfNZlsT95R2LdgO4yr3mS+obVougB6Vsp2bSObLumJjA6c5o9pq 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: Mike Rapoport (IBM) Reviewed-by: Christoph Hellwig Reviewed-by: Kefeng Wang --- 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 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); }