Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7793895rwd; Tue, 20 Jun 2023 06:23:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SJekzd3fHePs2eF85QajZRuHMVtsuH4B84nAkKgMrYl8XPXOwgqrAmH2dCT6jM/9EWRg4 X-Received: by 2002:a17:902:ed13:b0:1af:fd3a:2b7d with SMTP id b19-20020a170902ed1300b001affd3a2b7dmr10698034pld.48.1687267430950; Tue, 20 Jun 2023 06:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687267430; cv=none; d=google.com; s=arc-20160816; b=tPsK0z/donKG5w2gFhdpRbo0u1nIdsyEm4oPxK88B5Vgx/87B+lP4UmtkH3MUoGXAP HlBjQubb2EEyKgMIQEBRYGS/fKKGavY6F4PaoCNgxZg9fSE0pr7+u6Jzo2E1z4IwlM89 aAQ4iIhX5hmjvb0rTEDoouCDslOrTIbbDoN3nuRQ/AeM0Q1eZFdcojgdeF96kjauh1Tm 40hA1gNc9pPaibwHqF5rrZ4KV3qw3YJFnoFV2b2WU5S8siPgZ1DqtyV7YF5yc/woOw+1 zcHXb9Wna2dRcby/B6mLfa7h06oLsYh24JS6/gB/AzP73cXPRidgnz9w9cprhPZmoKFR 3slw== 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=rtnilJ5F4LLl+4CEx2GLwpBdJcJG1HwlPkltnKMCIXBXs5tr3+ugLKAYhkDTuM1hFg NWh/z8CAA9G5BiAmXoO/J3XN8CuklYu5awbIgEHwl48QhO2NgwiZJRYGtUPmAlwN+MHO C12q411/3Q6Mnl7fipsznLE4M8g47oBwaIjzVKAATQeTegVFBH7pX1GvFqEd1q+9SvGt WyKc3Rb4azFzjgo0Eoh01zAWtfmwcVbdlMICclWe5hJ7Zg++1cMOBNcAyfqCrk6Fo4EK TQwgrsv1+7zkvMnBpV0C3lUX0v8/cPvV0J87lBhZ+gBLd6YzO6084vp6GC/4PYRzSnY0 Ij6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T9xAvU6o; 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 p8-20020a170902ebc800b001b672af6243si2025308plg.541.2023.06.20.06.23.37; Tue, 20 Jun 2023 06:23:50 -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=T9xAvU6o; 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 S232144AbjFTNUJ (ORCPT + 99 others); Tue, 20 Jun 2023 09:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbjFTNTJ (ORCPT ); Tue, 20 Jun 2023 09:19:09 -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 5A2D419B2 for ; Tue, 20 Jun 2023 06:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687267081; 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=T9xAvU6obrzgnWlxVwbyMALA//lcNvXWGOC+FEbmvI0LIHjtjucocgjxn8lfiB9VNyjtBX VoEWoPKwdi1qrHMIKj02v09O4ZYJRpIG3UBh2jDK8jQnGks8ZhNvPsRufgHerIf/Dz7/R2 oDv4T/aGt/ti3UFDPPjFkXjcwDFd5tQ= 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-168-10jviPZINQmT4T6apGJu0w-1; Tue, 20 Jun 2023 09:17:55 -0400 X-MC-Unique: 10jviPZINQmT4T6apGJu0w-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 934BC3C0F691; Tue, 20 Jun 2023 13:17:10 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-166.pek2.redhat.com [10.72.12.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA753C478C7; Tue, 20 Jun 2023 13:17:02 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.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, David.Laight@ACULAB.COM, shorne@gmail.com, deller@gmx.de, nathan@kernel.org, glaubitz@physik.fu-berlin.de, Baoquan He Subject: [PATCH v7 19/19] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Tue, 20 Jun 2023 21:13:56 +0800 Message-Id: <20230620131356.25440-20-bhe@redhat.com> In-Reply-To: <20230620131356.25440-1-bhe@redhat.com> References: <20230620131356.25440-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.8 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