From patchwork Sun Jan 29 12:42:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13120102 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 155B4C636CB for ; Sun, 29 Jan 2023 12:43:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AF146B0074; Sun, 29 Jan 2023 07:43:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 785A86B0075; Sun, 29 Jan 2023 07:43:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 626C66B0078; Sun, 29 Jan 2023 07:43:22 -0500 (EST) 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 55EAF6B0074 for ; Sun, 29 Jan 2023 07:43:22 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3B4254051A for ; Sun, 29 Jan 2023 12:43:22 +0000 (UTC) X-FDA: 80407802244.02.E1D184C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 851D3140002 for ; Sun, 29 Jan 2023 12:43:20 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R0nQr0pB; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674996200; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xy1AuSmU3UO2Hyg7uQ5E9d+be8U5EAeeGv5ON7bkL+E=; b=UV2A3hsbeQNV5VygAOv7sqfWfxKXiJjJRiT2vBb6G1AYWXa+neS2OD49kmmafNMV+VbuFt TM+2AxpH26fFMwvbpARru+p8dUpjfKhh5cYlOVSJhPXjv9C2h+OvB/7DzowJugId5e5Vtt vY7VYAwUUtlkvZLYN/2pGRHLutIle/U= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R0nQr0pB; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674996200; a=rsa-sha256; cv=none; b=2cLaRW85rY0xmtUrIzwA/1BjulPKRArw7SAgTItpaY4mZx/is9f9sY7uJ0BrbmcJfRY9QP Z7PNQrUSDjkFhSkTxjS0Go3I08D9GgOkRFoSq2oeBdlLBf3cMnhvQ+RDJZUgEpIhrlOD9r Wmi++k4yKOeZkXYymrwZBiNlU1anPZE= 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 dfw.source.kernel.org (Postfix) with ESMTPS id ABFF360D42; Sun, 29 Jan 2023 12:43:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB863C433A8; Sun, 29 Jan 2023 12:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674996199; bh=LN+b67L2GuYmW7NwwfmoYPOQn6/pUneVShVCsQXwAMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R0nQr0pB/ARk6wpI1wApVcVwgzvL3nJvZL0d1rEEnUQjWCN8tFtMC8RLAoPrMcWp2 RDTPNMDGCtYLZKrFtqYc+unayS8BpfmpBREVaITviVkY9SQqoa9DIPak7ZMaylUoNU XkEUMVMunXKWmZPR9BcpXjNlA5vQUkeeuQZo5bDTV+GIseFI+xGOGnl6U0jF878itf mh/e6H0Y33/zTuC21r/0CJPhnc1+7P3/Qqea7El3CYfWpYJrYLN7QObiWb+sV322Md 3wRUSA/Myj0DO5A4pbRCW2jOQFtmwI9nGJsN3Q1ij2VEBYnaXPWn8lukuSf+C48vvu mJ0VjB6iJLE0w== 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 , Russell King , Stafford Horne , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.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-mm@kvack.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 v2 2/4] m68k: use asm-generic/memory_model.h for both MMU and !MMU Date: Sun, 29 Jan 2023 14:42:33 +0200 Message-Id: <20230129124235.209895-3-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230129124235.209895-1-rppt@kernel.org> References: <20230129124235.209895-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 851D3140002 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: k8ozsnrzcwtqu5u8jj7cqe6n9crpbx7n X-HE-Tag: 1674996200-255408 X-HE-Meta: U2FsdGVkX1+oYD4RRRDi0oKXID9VsHeTyPVWqFvVOpagTDMHYG1i2RgxmMSEHmiq8aGauCdGokGFJ+wCmoe0MxOXiO1CjA7BA3K1hHXiMHljq+lPCE5SD8NXGw3SH+Dd7k9aieggB02ThRFXQdNLeSwzNRmlqmXBzj8B+zLxiOciTEuC0gwS+vA/gUanoqLZ8q5hdVwN0iIJz6j0zWGk1bF0Z1HJexoZ8mKuL2NIBbxrh7Pz6OX6YDVKcxIRRumoDYl91tZVrGmqwm86n8fMJAi1SBMgWH2r6pPZ/Wy3XbFmWsKZTWqW0PTSTYw5sUXgvD3yYuNrYplaUiXkchROjbykQoiEA5kiyAIsqRtB2Kze6qCoYlS/ZEayDwOYt9x++2J7WujVctofe79vG6n7X9yi7TCXDLXKX6wfRfIvDU5H9Mb/pA1+6yVQZBjbR0FWcwjpBCLCJFa2ACWrCBRbxSo/Y8o1VFuHKgEV3eSeQIRsYuute9yL+yiBX837AytAYJiTKICX/PkGF4HFO6731d4ebpjYDetirbO3swNn25pQhn7ZeHR9P/mRDG62BSqeWCeGHs0NawNvFadh1I/ZXavz4uPnn8TpScNQ1Up6CXP23VAEUCIycObxqXTSYvYw4E+TLDsWMUKrcG6p7PCBnCEYkzLXDCfn6wwuznAuadPZQZkbg3p392bFvKtHEYLGo5DGoNfqCgv20tPl0UWiUJLz/jLBbO8BdMn3DuaCg+YoS+BjOZ0RHnm71J+6PsWNXrFYyr4HJ5ry5k2bh8DI/dWietroVVHbTdQGymRQchw0omwIkHNkyw9vT8WOZbLfm3/UZmzD5e26dCd1MXDTU6gdyQ3UA1/doguXXj2b+lTRNUNMVVke3Efchddfs9Y6f6UKJwD+czJFdR/wXV5TEwFLC23VAmJ3oQ/Kqrmh9tTR7DX/i2nPJ4Wpkg7WT9cQWRLsSoFYkOZ9XKhnRFc Db6xmb6u dz0DGK6+WmfifyvJziCwBzyFzKs05BLlNonrFgDYF1MsUN5jtD0ua05OyItlYuudRGSEYrkfWswrcteqCUq2BjncGMXpnqLBBa+8NtHoRB2/VlQiG9feI3OQ+ISGvsE2gyok+kom4HlFasbjZjoL8XzFiP5Qg3vDr4vtBjWpAueBDfLfNnbj0L/IIw2cjXN4W7bojpnUNhg3tRWj1l4RKRh+F2pSxgNSDrHqSLJfqfFU1TnsgvBx08OXH3QO6wrQOIWc73yzpWxKqZch67IwqnNGBpb1J0IRzJlQTwR1ztdlnOZd/GPQJ0NK1OPyUgs18a0qHtpIz4jBP3vtL+9x/7JNzNSs4n+qbL/y27xOAk+MwXuG03aeZyDkOELIq/+O/KoeuS493Iof9R9O22Bvu5rZcMw1iXHFetMqQqQg6LeCYekNZCohvKM+pTWT27qJ2zJiJEhmA/unM1142q6K7EbbFTCAsOMHAMJ+uz35eQcCWAVpMjPFAiZk1jSMp/TyPPF1fGaFJEq/sN3FPOQ3Y+dKuEzVnIE6oeEjj7phDZyiy/Hc= 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: 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 Reviewed-by: David Hildenbrand --- 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) && \