Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30687598rwd; Thu, 6 Jul 2023 09:15:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFeaaFtYC8wjVJSw1b+4oPWyssX5NIPyTAkt/A6mbik+lwOXxsAlCcmkU4ezIZE7NtUfT6I X-Received: by 2002:a17:90a:ea05:b0:263:e122:a692 with SMTP id w5-20020a17090aea0500b00263e122a692mr1868131pjy.49.1688660134928; Thu, 06 Jul 2023 09:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688660134; cv=none; d=google.com; s=arc-20160816; b=BtNm1PNmFtaNah3z8D9zDRMwC1z78hQgCuvijDl60PgPXgcWx6O4aMjTqpRgSGi1kd kq7xq3gXsxr98bqLdp4lRz2xdgBgtZEJzr7pt7gTEp3R8Z+d6353ZKq/51fySHyac8jk FN8/4U/4d+c0MjzrVvXCG9XPWY72k+r0gQLBw2B23qhjXTn508PfYPSb9l/3Y1+ZUq5q 8CF4bUJpjNKDN/Spt8sJy7fXvSoZcglUCtUTspp1CpHAmoQIrJA2GORXLs/URERvGXIR 9BGc4203H6DxkKpJH2PV8PShFpE9/jwB9s4QgBHGIJraVXFtcBrb7qoBlw0rIzmmqZ2h TDtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=keQ78Mv/VCFMjxLJbgEgr2h/sjN0UpPUn6QsvR3JRNU=; fh=MRqAqm0/X6LLHlLdJym4NBXwcTEGRfSmsWs7mgX78Dg=; b=TywLOssMMbTI/EziCgGwXFLQOu3YDeEmS6Uvhl2I6s6NSGzJ3JY3HISRdm6OX4L3sn QSAkMe8VnYQLt+PEcNgqlw1coDfX8TCQ33nSME9zMExLm3YKGJrOZMuRFc84nskgK/6h oTtTU0heomGE1ZIQ6IBpnE7NBPvTpvNTRSrHDRwkXJMD1U6yKHQTyVf2LJB7y1WkLRMU F4Ktw1gFKMD6LngTF+nuyP6OICy4XWcQgKGYADEjN4erNZJggqOgFVSfcbW7HxSXi4wK dhE315tk7P0+PJItZzocQ2trYUXHKfSa/IkOYMWLg5sCMv1pBxhXRfQ/+wqdUgynzdAA Z+VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZayEjbbt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n36-20020a635924000000b0054fb23f1018si1809167pgb.656.2023.07.06.09.15.20; Thu, 06 Jul 2023 09:15:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZayEjbbt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232699AbjGFPuY (ORCPT + 99 others); Thu, 6 Jul 2023 11:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233194AbjGFPty (ORCPT ); Thu, 6 Jul 2023 11:49:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3052718 for ; Thu, 6 Jul 2023 08:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688658519; 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=ZayEjbbtLA/Yh0N09UgzP8zv3i8GCx9TGSJhLA3XlsPeufPOqgazsUih03XORVq1fU10tz QP6xJ8ySQjxKeS7/Ldno4dpyEd+E895zcY5Ubf3+MJe6qoPHVW0rY7r24FajBOPPuMo3dJ 8pzMvrfsWA+y2fWUSPdWp5lzmLnTswk= 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, TVD_SUBJ_WIPE_DEBT,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } -- 2.34.1