From patchwork Thu Feb 16 12:34:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 58027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp277788wrn; Thu, 16 Feb 2023 04:44:27 -0800 (PST) X-Google-Smtp-Source: AK7set9W/bh0tBz7jKHBveuIEom0jW3rQKdX+8D1foY3kkMW1zKZDHSMxKGG4J4y7wsDQJiNJxM3 X-Received: by 2002:a17:902:ea09:b0:19a:9a66:9030 with SMTP id s9-20020a170902ea0900b0019a9a669030mr2018020plg.4.1676551467185; Thu, 16 Feb 2023 04:44:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676551467; cv=none; d=google.com; s=arc-20160816; b=tCSUizHzGneuZNVAh8y97dC+m+BexNXMCZnDK0N0zVAo3brQ7KbiY/WRQ+p5fdvvy2 R6VAFGrwJk/pzibpKxn90tU14/sVv9C8xHk3jjdVY2BKpjKBP24AZiGrFkNRpI+gR6Sl ZrGXVNoyYUB57ONR6Z9qk5wuSSXvZ1zFT78mRroFfUS/PsdCWS+0savkUxTMdlFOK6CP g1hpKTHaFlOh7Vva6MBRwqf7D80jorWdrZg6xGoAG4X9Y+nWVAqtIOqqD8TE0pgtwD6v NBKffJtRkr+rJnY6PowrUbQpIxIZeTGXyghm2+cvgQEa2WDRf/2shIhjvCW4sgLcgHuh TqWQ== 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=sZjhNHfCq0k8rI1ELCJTN8u4w8f61XUm94YTHptLe20=; b=tNjC5ZvSpKqJvXz52BqpoyAKN3pI0Y9/1qSgF+MIWW6gNn6P8AW01lTifPXuXVpdYd Lrq66l8MTfrChSabJZzvpQp2UJLA72o/G4mijv8aV4wJ3Sv8240UylfSml78M+54U4nK wUZ22uR23mNW8OtTa9xIPOmbn8TDfM7haRFt1qvD7W7hmvb2tcHL+crtjX5S5bYw8sN5 5cdtrTmeUnW9graWlgpHE5LGjH5I+qtvEK2UrSIeE4tcxZ8HaH2LDJHouua1AivUmq5Z di/oNrTUyaIja5CnL0O5mHJeFoNCXTaxA/PRKfIZyZfFYeSJwAqKktPYNOfoeLB3Uz0e eTTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HanqESI8; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a23-20020a170902b59700b001967bfbf0c3si1340092pls.300.2023.02.16.04.44.14; Thu, 16 Feb 2023 04:44:27 -0800 (PST) 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=HanqESI8; 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 S229623AbjBPMiG (ORCPT + 99 others); Thu, 16 Feb 2023 07:38:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjBPMiF (ORCPT ); Thu, 16 Feb 2023 07:38:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B11233B3D1 for ; Thu, 16 Feb 2023 04:36:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676551000; 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=HanqESI8GhbZ3S4axeXtCXJGFgVWde698u5t9epuR0sgrWqgcd9Vmwyzye3XcwHk8p/9A1 kqNAbVk7iMFNSwQIZshk7W6blfZEilXCp3CUEbJN9LGQIHpoo6hep6IYn0jOqoJAaFw9HX JoRy2PwX3Oy+Crq2Nh99t3+V79JfpBI= 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-297-kAAWe3RXPKal2kOmpWdx2A-1; Thu, 16 Feb 2023 07:36:37 -0500 X-MC-Unique: kAAWe3RXPKal2kOmpWdx2A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AEB7F85CCE0; Thu, 16 Feb 2023 12:36:36 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-99.pek2.redhat.com [10.72.12.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37CFE492C3C; Thu, 16 Feb 2023 12:36:22 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, 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, arnd@arndb.de, Baoquan He Subject: [PATCH v4 16/16] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Thu, 16 Feb 2023 20:34:19 +0800 Message-Id: <20230216123419.461016-17-bhe@redhat.com> In-Reply-To: <20230216123419.461016-1-bhe@redhat.com> References: <20230216123419.461016-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757991631558497912?= X-GMAIL-MSGID: =?utf-8?q?1757991631558497912?= 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); }