Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1737542rwd; Fri, 9 Jun 2023 01:07:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62Q2uuD2a8qDjBpuOI/Yj0zhLVeYiCdrm109IhWj6QxRfro0acUiGOjM6n96Jo6Iqso5M4 X-Received: by 2002:a05:6808:21a4:b0:398:36ac:44f1 with SMTP id be36-20020a05680821a400b0039836ac44f1mr1134226oib.7.1686298040925; Fri, 09 Jun 2023 01:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298040; cv=none; d=google.com; s=arc-20160816; b=WTa8/xScUdXr/h05ccIDD8Qr7KQ6pYvVsHx4A9ZWWlhuZlO/0ZplcnDQAnxr8FYJPm oyN3d3Zh/GFnBrinT4JILWvZd1qe9c6bseWc7lVhZPN96Rryz6VhsU4vvUXklBeUyy32 zD/YVX4oK1NEAkZ1JvGk7S/RvCL9ZLdGJVNJj4JgwasOplIJXi6YtFkgIqpANQWomsbQ o3eKipj9lHvBpMsKJVuOGSunpdhKYPtBlAbGcALOvhH3wvMaeugThpfF0W5u1PT04LAX HQWHCxiY6JpFDimto2UcX1AbzhO4v6k2jUNkPKDxxstBrscqycJ2emV1X2h3QiPAOOPo eDcA== 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=; b=AroyaFIXyE4tbAvIqlh1QrxdyAXKspKiNDXufhVTThbAOWnzy314fmriq8MyY55uWA 7y4UrozLuadpIdMFNMfXPt1Eywc5PaTubCfmTRgNjb+tIcFrf59H21ToD82SOwBvXtHA SmpdJxwMPEh/HbklOvpYfYXnxg2am73ScHG5+rFNKDTGQWb1hjm6pcW9a1yPxJ1NaK9i Rqet5GbyZzuTQpOGBL6AFLuqaTyB7dRkQnJG95qNNbJ2ntKTLcOWdao2iRnFu2YbM5yL J6bIhfCmefIZL6O8mQH1EXHvRkzGQ714PIDLMGX3Z6RiPapbLladf34UJfjZR0D5Hv4T +Pxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="D6La/hwR"; 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 l7-20020a17090a660700b0025667dcd6ecsi2237827pjj.120.2023.06.09.01.07.06; Fri, 09 Jun 2023 01:07:20 -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="D6La/hwR"; 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 S239929AbjFIIBI (ORCPT + 99 others); Fri, 9 Jun 2023 04:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235585AbjFIIA1 (ORCPT ); Fri, 9 Jun 2023 04:00:27 -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 97C0249C2 for ; Fri, 9 Jun 2023 00:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686297475; 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=D6La/hwRfReJ4WdYtJ2Py8lbsq8PRvObxqiXrkxgw8G2HnyfXkT07cEvMZPY28/Wqlu4Vj r4Hstw2hiCFgf1zdd92BG2qs5nRqBDWQqi8z/l5GeIzwg5mvsj0HsAddvmBP2f2UaKmEEj 8c5QMf8dXqXu7MBs+8my6QXRei25Y1w= 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-380-jhbKVNRpPu-vZvSBv7VYEg-1; Fri, 09 Jun 2023 03:57:51 -0400 X-MC-Unique: jhbKVNRpPu-vZvSBv7VYEg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF9B83C0CF05; Fri, 9 Jun 2023 07:57:50 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-92.pek2.redhat.com [10.72.12.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4930320268C6; Fri, 9 Jun 2023 07:57:44 +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@lst.de, 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, Baoquan He Subject: [PATCH v6 19/19] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Fri, 9 Jun 2023 15:55:28 +0800 Message-Id: <20230609075528.9390-20-bhe@redhat.com> In-Reply-To: <20230609075528.9390-1-bhe@redhat.com> References: <20230609075528.9390-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.4 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_H5,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