Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3343918rwb; Sun, 9 Oct 2022 03:34:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JcQqc0B0R8mHc+6+m4n1rMUja7AZR1nlNORstLhLEXOpU511Om7MH/ylDEUfyQuE1hmZP X-Received: by 2002:a05:6402:1052:b0:459:2c49:1aed with SMTP id e18-20020a056402105200b004592c491aedmr12881979edu.212.1665311675886; Sun, 09 Oct 2022 03:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665311675; cv=none; d=google.com; s=arc-20160816; b=LL8gGMUc7h+Kxe/RZS1Y/xzeJ0JSDufeZzwuQdIEcoxfL88wxrlrYqA5nOKwESTQGb 18P4Jr47ayaL4jioJ8PuwJoIgjLkHnLTAtpVpo2+9Q954mB5rJR8ns4PGLOQiCbsO9ZC 0NXgh12tY5mu11jEsxGceFkodkysnz1ENxH3oPbGmYlmPjWE9T0vWUOIRR4OF7IjN3+Q NXy+l743L1PRvxuCZrXHu6C6z1JBWuvQbd6Gt8ZuJtQpsaUmGp/7YDu8evktqyAtvEeL paetW4IJ5Vgsn8ZbxP+8oj2xx0SkxKLPlypsnPqdXRzMuav2texCMSLu+NmXLB2Sm6pW lhfw== 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=1cXjxLGfG1GBa+cjM88n4B6gIxUK4HiTfwhhDRLHWsM=; b=g/CeWGogTe8+w8BnAXJmevc8dyJym/qbob0JSj8Dm5/JmKQBuXMbeXYS+2IbxY/W29 BuM5UX9rIVAkl4XgdaNewPgT8DKXu3XlsS+ptDRUdwJ7Q3TxHluKGDeHqykrxtKk3w0i i/CDgSH+77BpnfCpr1+W8P/oEGbS9Omwtgvw/NmEbGmRdJlTvjb6nh9TCjj8L2ZUjSIp fZnzf0wUdIQi6IGhP6FrJfTJVzY8/h0ClCUcXFMiq1JymzcvnjlmI5c21LDmaTzjrUyY XnBMwlfpzVBi1yVQlrwXjxU6Kr+GdMfJjxSF6Pgks5oIJ+YgXs3YMEm1+GvDNeSttWb0 DXwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GxiPIcGz; 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 h15-20020a05640250cf00b00459dc4e4b3esi8497118edb.66.2022.10.09.03.34.08; Sun, 09 Oct 2022 03:34:35 -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=GxiPIcGz; 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 S230017AbiJIKcA (ORCPT + 99 others); Sun, 9 Oct 2022 06:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiJIKbv (ORCPT ); Sun, 9 Oct 2022 06:31:51 -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 89F712DAAC for ; Sun, 9 Oct 2022 03:31:47 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 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; } -- 2.34.1