From patchwork Sun Jan 24 07:37:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanteng Si X-Patchwork-Id: 12042123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1CEDC433E0 for ; Sun, 24 Jan 2021 07:39:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 665E622B48 for ; Sun, 24 Jan 2021 07:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726435AbhAXHi7 (ORCPT ); Sun, 24 Jan 2021 02:38:59 -0500 Received: from mail.loongson.cn ([114.242.206.163]:56270 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726038AbhAXHi7 (ORCPT ); Sun, 24 Jan 2021 02:38:59 -0500 Received: from localhost.localdomain (unknown [112.3.197.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxRb3CIw1gZ8cKAA--.13975S2; Sun, 24 Jan 2021 15:37:40 +0800 (CST) From: Yanteng Si To: Thomas Bogendoerfer Cc: Jiaxun Yang , Huacai Chen , siyanteng01@gmail.com, Arnd Bergmann , Greg Kroah-Hartman , linux-mips@vger.kernel.org, Yanteng Si Subject: [PATCH v2] MIPS: mm: remove function __uncached_access() Date: Sun, 24 Jan 2021 15:37:55 +0800 Message-Id: <20210124073755.1287129-1-siyanteng@loongson.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IevJa73UjIFyTuYvjfUoOJ5UUUUU X-CM-SenderInfo: pvl1t0pwhqwqxorr0wxvrqhubq/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org MIPS uses this logic because loongson2e override the definition of unchached. However, now the logic of loongson2e has been removed, so MIPS is no longer needed. Signed-off-by: Yanteng Si --- arch/mips/loongson2ef/common/mem.c | 11 ----------- arch/mips/mm/cache.c | 8 -------- drivers/char/mem.c | 7 ------- 3 files changed, 26 deletions(-) diff --git a/arch/mips/loongson2ef/common/mem.c b/arch/mips/loongson2ef/common/mem.c index 057d58bb470e..fceb3ee47eb0 100644 --- a/arch/mips/loongson2ef/common/mem.c +++ b/arch/mips/loongson2ef/common/mem.c @@ -41,14 +41,3 @@ void __init prom_init_memory(void) memblock_add(LOONGSON_HIGHMEM_START, highmemsize << 20); #endif /* !CONFIG_64BIT */ } - -/* override of arch/mips/mm/cache.c: __uncached_access */ -int __uncached_access(struct file *file, unsigned long addr) -{ - if (file->f_flags & O_DSYNC) - return 1; - - return addr >= __pa(high_memory) || - ((addr >= LOONGSON_MMIO_MEM_START) && - (addr < LOONGSON_MMIO_MEM_END)); -} diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 23b16bfd97b2..9cfd432d99f6 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -207,11 +207,3 @@ void cpu_cache_init(void) setup_protection_map(); } - -int __weak __uncached_access(struct file *file, unsigned long addr) -{ - if (file->f_flags & O_DSYNC) - return 1; - - return addr >= __pa(high_memory); -} diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 43c871dc7477..869b9f5e8e03 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -291,13 +291,6 @@ static int uncached_access(struct file *file, phys_addr_t addr) * attribute aliases. */ return !(efi_mem_attributes(addr) & EFI_MEMORY_WB); -#elif defined(CONFIG_MIPS) - { - extern int __uncached_access(struct file *file, - unsigned long addr); - - return __uncached_access(file, addr); - } #else /* * Accessing memory above the top the kernel knows about or through a