From patchwork Wed Mar 1 03:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13155583 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 2E577C64EC7 for ; Wed, 1 Mar 2023 03:44:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C21FC6B008A; Tue, 28 Feb 2023 22:44:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD22C6B008C; Tue, 28 Feb 2023 22:44:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9B0A280001; Tue, 28 Feb 2023 22:44:51 -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 9B0C16B008A for ; Tue, 28 Feb 2023 22:44:51 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7ADD0141072 for ; Wed, 1 Mar 2023 03:44:51 +0000 (UTC) X-FDA: 80518937982.02.6614C10 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 B77E740009 for ; Wed, 1 Mar 2023 03:44:49 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="XXha/xgJ"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.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=1677642289; 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=RBjjpV/ErJL00lwsnvzGICSOaC6Kvbluv/CnnsUESMIQMUAgDBFvHdru3EfFIRWyLGPkeu CYokVWLUki4ykPa+1fVF9fpLMbYFBv8I6rQDZfKqLmrcTZtY95RL63CTnPi5aKBlTxC7lm C59TN+pE2CGdFqLnTjrFguDiERGaN7U= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="XXha/xgJ"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677642289; a=rsa-sha256; cv=none; b=oGu6xC9Ph0ZLsZl5WYu+1ZhKQ15wJwbBO2pu2BQeIhfs4JJEj+6gT6gatUvRbMo2cRqPbw zgKKxPp2SjgrSLossfVdbBYcOQf+OUUph/5xtkIk/fsZWQD22NXDEOX8H34VD3ZPFpq2g8 MHorJbNPeysY8fVNmpu9td+Wtrlqxxs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677642289; 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=XXha/xgJn7rNDJveHy3iMk0u/MIKCYaj1UQfGgsgoPuz8zsJDq4j6Cxd71HYfi1IZqcI/9 A4DHOOuPMbkbasB5Ev3G12i3CGP5Sn1Ii08oXU8saYUzFM4SY1wtF0l9XHQB401xgF5wwD Mra/Rff0hLxI0YWcne5IzmT4bXoRLUw= 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-596-L7cYu-UcO7uMwCSPp8Rblg-1; Tue, 28 Feb 2023 22:44:43 -0500 X-MC-Unique: L7cYu-UcO7uMwCSPp8Rblg-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 451DC87B2A2; Wed, 1 Mar 2023 03:44:43 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-180.pek2.redhat.com [10.72.13.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2A5DC15BAD; Wed, 1 Mar 2023 03:44:38 +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, Baoquan He Subject: [PATCH v5 17/17] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Wed, 1 Mar 2023 11:42:47 +0800 Message-Id: <20230301034247.136007-18-bhe@redhat.com> In-Reply-To: <20230301034247.136007-1-bhe@redhat.com> References: <20230301034247.136007-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: B77E740009 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: ykngcirfd5hdtyepykfu4tj843i3pedo X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AmrrXQtXoK+vbOvNN2VIo+Gvsz3LinZd5X9qT+/J2UCJI0i7eTG7QyQeEU4fViuJQBnfuAzwNQxHUGlmEE2WzTtCmUJCGbQ6qSNpxu7WwFMIZHQg8Mwr1qrLSUtEKoEU7atf0V99UHN2bRXICKDJJziKhqwo2ZJGI29aMA= 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); }