From patchwork Wed Jan 25 19:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 48267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp439701wrn; Wed, 25 Jan 2023 11:10:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsPfzA2HZfeoF6fCIrL/XbCVhdAPa2+zp+3U2AQlGHPG8JmOA+KlryiWB3DgjCUmRsBskAu X-Received: by 2002:a17:903:2284:b0:194:928c:ed45 with SMTP id b4-20020a170903228400b00194928ced45mr42948609plh.39.1674673828961; Wed, 25 Jan 2023 11:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674673828; cv=none; d=google.com; s=arc-20160816; b=GzxEyHXlTv+Hbz02buMNSuds+TyyZtC2a5N0IHNsV+k7Cl0HCqgXMmCjFNcN4qZj0h 0HPU1t39jrAO3unxJtzCjr/Add8J3hhzeHciUcpXsk/zAP6LsVD9ODhHrVsZfJBYe81J wf+sqQFQPDP3IYuYi+OerTy+zHfQov2h13q/G0hAolLozrIBmIjks7FboyX8nBPn5F5f AIMQI6apOtiQQ5JKaNlYYpj1BwQs7LQCRr1KKBuA6btVFxWRALkqOPVcsDw6PUJlVi8z Hd/NT6xLlt8p0HlYCaF2jhDnP2V3OrliB52JklEqnzIWB3WuRR0C/G5NodpqD4zE11ru o/GA== 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=OG/oAM8yiZoCoaAuN7GXd5kxV4RZotIZU+jZb8U2Kuw=; b=MY9ocC67g/YhujbTpq3R1Mz72EcPheHEIBHVHhhPjHfrmQqC21u+1HM6EwwZhYkkKc YFzdhdPaQqOoU9FFPtTDfEyWKa5AiUOLy32N+ouDC2sks7hMpfeIpi9aqevOSFTh2cd5 5ToOGPR1PgiY66epEdYmEtM6rnqzfTxN9a++AVX4POoKpxGlAWVSFXcN24lbALBV5MU5 zTrj/UU1RngHSA64gF2DeE6SIzwU2ci7vYvUBnnEoKNlyrkQ4TcSzKiQ5PfOLxm4lsHa fcNrKizJpl3hzmVIWVgDLFeihhrsgpdrRa31w+LpGgB6O4EHFm06tFQXn3lJCJDWjXO/ YceA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VayjFvjT; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170902c40d00b00194ca747aa5si7220569plk.169.2023.01.25.11.10.17; Wed, 25 Jan 2023 11:10:28 -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=@kernel.org header.s=k20201202 header.b=VayjFvjT; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235503AbjAYTIr (ORCPT + 99 others); Wed, 25 Jan 2023 14:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236091AbjAYTIk (ORCPT ); Wed, 25 Jan 2023 14:08:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF6B599B3; Wed, 25 Jan 2023 11:08:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84FE1B81B41; Wed, 25 Jan 2023 19:08:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E85BCC433A7; Wed, 25 Jan 2023 19:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674673710; bh=e5RD+ChFYW/EecHl5ap2SmlVrekFipkC772OqZMuVGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VayjFvjTXPvWyL/99q0Q7Vo5BJQIU/QWsdqT9U6kg3Xi9+KratRvjQIvNgQZNC3ej 6x/V1dpkk1wIjhfkSpo4tsDE6LKiO+Z94AT9MrMhVBrrQvC4crABv3iZAhx0hPAdnc G/Kplj04nGqfPkVb2pBjO0GqI2SeHuT5hhqCing4uoX5Nyi2JGI89yALKqEotm5cXW IVAcb4mE1j1I4sF505IYGjEOjQNXyPndc4ldxqG2bG//O/g+ApLa4k300Bdp2RDaS6 +A5XNi3/uTO24fyw3WkB8WmX8CDXexEGrS2YKYpiYOPBhNL3AuJAnu+PeWPrPw3UmH WPqMRKYef77Yg== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Stafford Horne , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, x86@kernel.org, "Mike Rapoport (IBM)" Subject: [PATCH 1/3] m68k: use asm-generic/memory_model.h for both MMU and !MMU Date: Wed, 25 Jan 2023 21:07:55 +0200 Message-Id: <20230125190757.22555-2-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230125190757.22555-1-rppt@kernel.org> References: <20230125190757.22555-1-rppt@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1756022784944663951?= X-GMAIL-MSGID: =?utf-8?q?1756022784944663951?= From: "Mike Rapoport (IBM)" The MMU variant uses generic definitions of page_to_pfn() and pfn_to_page(), but !MMU defines them in include/asm/page_no.h for no good reason. Include asm-generic/memory_model.h in the common include/asm/page.h and drop redundant definitions. Signed-off-by: Mike Rapoport (IBM) Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- arch/m68k/include/asm/page.h | 6 +----- arch/m68k/include/asm/page_mm.h | 1 - arch/m68k/include/asm/page_no.h | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h index 2f1c54e4725d..a5993ad83ed8 100644 --- a/arch/m68k/include/asm/page.h +++ b/arch/m68k/include/asm/page.h @@ -62,11 +62,7 @@ extern unsigned long _ramend; #include #endif -#ifndef CONFIG_MMU -#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) -#define __pfn_to_phys(pfn) PFN_PHYS(pfn) -#endif - #include +#include #endif /* _M68K_PAGE_H */ diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index a5b459bcb7d8..3903db2e8da7 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -134,7 +134,6 @@ extern int m68k_virt_to_node_shift; }) #define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT) -#include #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index c9d0d84158a4..0a8ccef777fd 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h @@ -26,8 +26,6 @@ extern unsigned long memory_end; #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define page_to_virt(page) __va(((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)) -#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) -#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) #define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \