Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1747629rwd; Mon, 15 May 2023 02:24:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5p10ivbazukuZON2anvqslpGekKBnNVbLMELXLUFbhnH2wbOWvf5L+WEXPIgioDTggvclE X-Received: by 2002:a17:90b:4d85:b0:23d:a2a:3ae4 with SMTP id oj5-20020a17090b4d8500b0023d0a2a3ae4mr33653971pjb.44.1684142688532; Mon, 15 May 2023 02:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684142688; cv=none; d=google.com; s=arc-20160816; b=hk7/sQKRmgBq+REoi8yPy6z4MyPJlFfA8PaW4pXFAAL8kRtw6yz683Gh8jyilpzytm etPGYBo/GudLtAHA75lBWN0MHcYuVTzAwYKcqCTzvDe2APSW9502YAtvdCoMYCc0/FB4 wNt6uxAg7fAxCn0Mfb/IfkMPMjerZkHBw8mOucV3ee9fnjibqIbT0jVaf9XP0hv0P0qk kSyIehCsEj/ryqNNF+gR6/bgJVNd+g1sd1Ani60YEu0MgRQgtx0eW4Upu9xqPKcbGrDS iSExWsCpNbkMQt77rQ9qcprrJr29y325NFynM2uL4KGiHcJGipCSScS0EfwaU3rLHqQO LVow== 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=Sk5VOSJIfD7nFCF0xkyXJ4tPwauxuD4OFust9+6yntw=; b=WJfhw88ptvXxMTCnECNlYyjq2drvIxArazykhmrf2srM6AhDlNXTFdlLU0obLZpyxy Zrt4GgTbxgXUIGRlTOUy1DYC+Aat6wuNS703IDGkh28kgnhnTOZMkzPS6/v3rBe3d7HY xOxVWXxzxprxmIoiKcnKZr3QDvyqZkLH5eSpjmkHDXfhj4ndeSCvynKHxjL+htQ4tJSs IxexlhAV0UOh4mhfMPgPv7i7DdoQiIH8qL+wd45HaYGsIipKEP5n37BgbiF2e/nSw9Yn W+JHH1501dwysc8eH1HRlF0lAUqOFSlG7+CRwWJKb/BBhjCMLn61j/hjFb0sXYsCS+ua xjDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VRnTt56s; 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 13-20020a170902c20d00b001ab259969e7si15502900pll.31.2023.05.15.02.24.36; Mon, 15 May 2023 02:24:48 -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=VRnTt56s; 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 S240034AbjEOJQD (ORCPT + 99 others); Mon, 15 May 2023 05:16:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239252AbjEOJPM (ORCPT ); Mon, 15 May 2023 05:15:12 -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 B16FB30C7 for ; Mon, 15 May 2023 02:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684141884; 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=VRnTt56s7lV40QfGpR64BOmWWhbGOH288PNaDc4yS3BmwQwioKTZAEq+Qa40X87t8v9fnR i61lT7xe/cPOhQsCInCxa8yOr3fJbwa6UQgrfmHMzftxM1HKpPCiQUzauMBp7wEbRKWb1u 8UdWZd/jXv1PGpGdisQU4CpWeUjuHz0= 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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_H2,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 --- 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); } -- 2.34.1