From patchwork Sun Oct 9 10:31:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13001966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72376C433F5 for ; Sun, 9 Oct 2022 10:31:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D7B1900003; Sun, 9 Oct 2022 06:31:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0604B6B0075; Sun, 9 Oct 2022 06:31:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E25DB900003; Sun, 9 Oct 2022 06:31:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C89236B0074 for ; Sun, 9 Oct 2022 06:31:48 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 87B5B120A03 for ; Sun, 9 Oct 2022 10:31:48 +0000 (UTC) X-FDA: 80001045096.06.6B18E11 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 34CE540021 for ; Sun, 9 Oct 2022 10:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665311506; 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=1cXjxLGfG1GBa+cjM88n4B6gIxUK4HiTfwhhDRLHWsM=; b=GxiPIcGzWH2e8QCiQZ4XiJda192eEx4cXFL7ObQ80K1c3w3nGp9j09EJ5UXITBVhw+DkSX LWEL1QOdRMvhWh+42MbenbiIXbZNY3sfZbFg/AfDbyFO/heVnwSoaKjbK1YB/Nd84aOM4Z s/Lp5bb7sEeSh93MMyOyjda63114qeA= 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-504-w7Wzcy9xPomMLPYFG8YXMQ-1; Sun, 09 Oct 2022 06:31:41 -0400 X-MC-Unique: w7Wzcy9xPomMLPYFG8YXMQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A426029AB3FB; Sun, 9 Oct 2022 10:31:40 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-36.pek2.redhat.com [10.72.12.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E55940D298B; Sun, 9 Oct 2022 10:31:31 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, christophe.leroy@csgroup.eu, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, bhe@redhat.com, Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: [PATCH v3 02/11] openrisc: mm: remove unneeded early ioremap code Date: Sun, 9 Oct 2022 18:31:05 +0800 Message-Id: <20221009103114.149036-3-bhe@redhat.com> In-Reply-To: <20221009103114.149036-1-bhe@redhat.com> References: <20221009103114.149036-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665311507; h=from:from:sender: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:dkim-signature; bh=1cXjxLGfG1GBa+cjM88n4B6gIxUK4HiTfwhhDRLHWsM=; b=aLAG7ACWLtlcaSCIaicvCuvzu/BTeQjRVYn5ExcqX05ssokzrN3tm7Yd1lbMgn+vmi8Ux3 52eOLTRCcK296f43ZVY6bBUyDoDCA4hGtDFEI5dLxADLIN09uiNzCSBd1U76un7S8NgOFK zX8CSkk4XYWrfWHbksX76dfqIf2zqt4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GxiPIcGz; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665311507; a=rsa-sha256; cv=none; b=A8J3uubEpVYVPHAzujnfLF/Zb/J97Pny6M4FEQIjvfs6jMdBQxPXet0bJZWmBiT61Loab0 yAjnOwRtzaQKqKsDNGlGqV2oKXv0rQvFqshVxKL1M61MX9Io+3yCCShAbjsszu2sovZMxz mxJentQPLhpHsex7pq4sgDdO/FuSHew= Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GxiPIcGz; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Stat-Signature: 86bwjzd8px9quq5prg8j8mismankz6za X-Rspamd-Queue-Id: 34CE540021 X-Rspamd-Server: rspam01 X-HE-Tag: 1665311507-20237 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Under arch/openrisc, there isn't any place where ioremap() is called. It means that there isn't early ioremap handling needed in openrisc, So the early ioremap handling code in ioremap() of arch/openrisc/mm/ioremap.c is unnecessary and can be removed. Signed-off-by: Baoquan He Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openrisc@lists.librecores.org --- arch/openrisc/mm/ioremap.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c index 8ec0dafecf25..90b59bc53c8c 100644 --- a/arch/openrisc/mm/ioremap.c +++ b/arch/openrisc/mm/ioremap.c @@ -22,8 +22,6 @@ extern int mem_init_done; -static unsigned int fixmaps_used __initdata; - /* * Remap an arbitrary physical address space into the kernel virtual * address space. Needed when the kernel wants to access high addresses @@ -52,24 +50,14 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size) p = addr & PAGE_MASK; size = PAGE_ALIGN(last_addr + 1) - p; - if (likely(mem_init_done)) { - area = get_vm_area(size, VM_IOREMAP); - if (!area) - return NULL; - v = (unsigned long)area->addr; - } else { - if ((fixmaps_used + (size >> PAGE_SHIFT)) > FIX_N_IOREMAPS) - return NULL; - v = fix_to_virt(FIX_IOREMAP_BEGIN + fixmaps_used); - fixmaps_used += (size >> PAGE_SHIFT); - } + area = get_vm_area(size, VM_IOREMAP); + if (!area) + return NULL; + v = (unsigned long)area->addr; if (ioremap_page_range(v, v + size, p, __pgprot(pgprot_val(PAGE_KERNEL) | _PAGE_CI))) { - if (likely(mem_init_done)) - vfree(area->addr); - else - fixmaps_used -= (size >> PAGE_SHIFT); + vfree(area->addr); return NULL; }