From patchwork Wed Mar 1 03:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 62758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3427949wrd; Tue, 28 Feb 2023 20:35:07 -0800 (PST) X-Google-Smtp-Source: AK7set/7ik7JV1YH6NrUmk2xg1lmEy85DxEneYKSgRDVYf8AR8Bn6bZavV8cEa9dxQZPZ4Uig3N+ X-Received: by 2002:a05:6a20:12cd:b0:c2:f930:45e8 with SMTP id v13-20020a056a2012cd00b000c2f93045e8mr6217121pzg.46.1677645306908; Tue, 28 Feb 2023 20:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677645306; cv=none; d=google.com; s=arc-20160816; b=ag6nyagX65JEevFHI05sfkEYX9INWpgPC+7hhopG57aXteOtSRLtg1D6iYu3wwS0MB 93WOx2IPSvJqNW4LsM+TajyXJItGnD2GPlP82vIufzLhcBsPbaUDQ8/kqsWQMJVPsZZu JPIBihuPFHbx/6PjUBSf31qYPibSYXWQ7LEKri82/VwPkUJMJsY+hSQ0sRYBtAgkgDmN DUFzapQuEzGQdpsv9nyPUDRhmtwL50G9k5ccZpEIQqZvOn5OBulE71DhflFa06i/Zu2G 8PtZEAfvFItczdf+ivkKSmiTVqGOIQmNMDOvoN6WM6P/SWYfcoxYnZsIQvA3Xdu5oNLO aTgA== 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=MuXGRcfSLEeeR9/s1fDiivOxmor/DxvjzZGIOmndp0ddY0TWLYHr20clX2HAtZQRwq FO2N0TqJVJ82fEZkS70NhiqIOTgF90kHex1C2tgZJf/8tNogFswYfjCilvZpYqdw0nYS GH8dCqljXEsrpYa4A98QrpAnEBivnbuOL50Q3183gtpFUGrGNE83z7TJeFtMz1nUQ+qN xSQ1LN2usw++zMagGqaKTJ2dRQxX7bDHphFUjfAK7mSQoxzu4PJDMoTkPAir0xb07Szj n75wlTxFNMEISPlD068VluqxkqknzWxyx6rKRzR/Gko5GPXhEkpg8RKJr4MeUL62CQAD HBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Rf9JNNu2; 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 w23-20020a639357000000b005006386b8d3si11444059pgm.394.2023.02.28.20.34.49; Tue, 28 Feb 2023 20:35:06 -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=Rf9JNNu2; 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 S230111AbjCADqw (ORCPT + 99 others); Tue, 28 Feb 2023 22:46:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbjCADqb (ORCPT ); Tue, 28 Feb 2023 22:46:31 -0500 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 B845138EA0 for ; Tue, 28 Feb 2023 19:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677642287; 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=Rf9JNNu2+yCjCSCHzHveBLMEtVafB+hlxErDCJg4g/Pr/sHLDneCi+QHgXYvqmZUpd6mVc dvB/Es+6tRyq0f551vH98CPKcDGtpxRIFpzd+VdhYWVAWIEpSUZCsoo+jNsFyjilD5hzNT CfHalGUPOAUknvRzXgCUcatHQQDg8nY= 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-596-L7cYu-UcO7uMwCSPp8Rblg-1; Tue, 28 Feb 2023 22:44:43 -0500 X-MC-Unique: L7cYu-UcO7uMwCSPp8Rblg-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 451DC87B2A2; Wed, 1 Mar 2023 03:44:43 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-180.pek2.redhat.com [10.72.13.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2A5DC15BAD; Wed, 1 Mar 2023 03:44:38 +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, Baoquan He Subject: [PATCH v5 17/17] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Date: Wed, 1 Mar 2023 11:42:47 +0800 Message-Id: <20230301034247.136007-18-bhe@redhat.com> In-Reply-To: <20230301034247.136007-1-bhe@redhat.com> References: <20230301034247.136007-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain 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_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?1759138605838112229?= X-GMAIL-MSGID: =?utf-8?q?1759138605838112229?= 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); }