From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ganapatrao Kulkarni Date: Tue, 02 Feb 2016 10:21:23 +0000 Subject: [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. Message-Id: <1454407763-1017-9-git-send-email-gkulkarni@caviumnetworks.com> List-Id: References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-arch@vger.kernel.org, Will.Deacon@arm.com, catalin.marinas@arm.com, robh+dt@kernel.org, mark.rutland@arm.com, grant.likely@linaro.org, leif.lindholm@linaro.org, rfranz@cavium.com, ard.biesheuvel@linaro.org, msalter@redhat.com, steve.capper@linaro.org, hanjun.guo@linaro.org, al.stone@linaro.org, arnd@arndb.de, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rjw@rjwysocki.net, lenb@kernel.org, marc.zyngier@arm.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, tony.luck@intel.com, fenghua.yu@intel.com, james.hog Cc: gpkulkarni@gmail.com NODE_DATA is defined across multiple asm header files. Moving generic definition to asm-generic/mmzone.h to remove redundant definitions. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/mmzone.h | 4 +--- arch/m32r/include/asm/mmzone.h | 4 +--- arch/metag/include/asm/mmzone.h | 4 +--- arch/powerpc/include/asm/mmzone.h | 8 ++------ arch/s390/include/asm/mmzone.h | 6 +----- arch/sh/include/asm/mmzone.h | 4 +--- arch/sparc/include/asm/mmzone.h | 6 ++---- arch/x86/include/asm/mmzone.h | 3 +-- arch/x86/include/asm/mmzone_32.h | 5 ----- arch/x86/include/asm/mmzone_64.h | 17 ----------------- include/asm-generic/mmzone.h | 24 ++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 51 deletions(-) delete mode 100644 arch/x86/include/asm/mmzone_64.h create mode 100644 include/asm-generic/mmzone.h diff --git a/arch/arm64/include/asm/mmzone.h b/arch/arm64/include/asm/mmzone.h index a0de9e6..611a1cf 100644 --- a/arch/arm64/include/asm/mmzone.h +++ b/arch/arm64/include/asm/mmzone.h @@ -4,9 +4,7 @@ #ifdef CONFIG_NUMA #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[(nid)]) +#include #endif /* CONFIG_NUMA */ #endif /* __ASM_MMZONE_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h index 115ced3..e3d66a0 100644 --- a/arch/m32r/include/asm/mmzone.h +++ b/arch/m32r/include/asm/mmzone.h @@ -7,12 +7,10 @@ #define _ASM_MMZONE_H_ #include +#include #ifdef CONFIG_DISCONTIGMEM -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) diff --git a/arch/metag/include/asm/mmzone.h b/arch/metag/include/asm/mmzone.h index 9c88a9c..b1e95b3 100644 --- a/arch/metag/include/asm/mmzone.h +++ b/arch/metag/include/asm/mmzone.h @@ -3,9 +3,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 7b58917..da0c5ba 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h @@ -19,12 +19,6 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data *node_data[]; -/* - * Return a pointer to the node data for node n. - */ -#define NODE_DATA(nid) (node_data[nid]) - /* * Following are specific to this numa platform. */ @@ -42,5 +36,7 @@ u64 memory_hotplug_max(void); #define memory_hotplug_max() memblock_end_of_DRAM() #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* __KERNEL__ */ #endif /* _ASM_MMZONE_H_ */ diff --git a/arch/s390/include/asm/mmzone.h b/arch/s390/include/asm/mmzone.h index a9e834e..91f1fcc 100644 --- a/arch/s390/include/asm/mmzone.h +++ b/arch/s390/include/asm/mmzone.h @@ -7,10 +7,6 @@ #ifndef _ASM_S390_MMZONE_H #define _ASM_S390_MMZONE_H -#ifdef CONFIG_NUMA +#include -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#endif /* CONFIG_NUMA */ #endif /* _ASM_S390_MMZONE_H */ diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 15a8496..c070d00 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h @@ -5,9 +5,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index 99d9b9f..ef1365b 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h @@ -5,13 +5,11 @@ #include -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - extern int numa_cpu_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[]; #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* _SPARC64_MMZONE_H */ diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h index d497bc4..5a52815 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ #ifdef CONFIG_X86_32 # include -#else -# include #endif +#include diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 1ec990b..09f7cfb 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h @@ -8,11 +8,6 @@ #include -#ifdef CONFIG_NUMA -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_DISCONTIGMEM /* diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h deleted file mode 100644 index 129d9aa..0000000 --- a/arch/x86/include/asm/mmzone_64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* K8 NUMA support */ -/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ -/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef _ASM_X86_MMZONE_64_H -#define _ASM_X86_MMZONE_64_H - -#ifdef CONFIG_NUMA - -#include -#include - -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - -#endif -#endif /* _ASM_X86_MMZONE_64_H */ diff --git a/include/asm-generic/mmzone.h b/include/asm-generic/mmzone.h new file mode 100644 index 0000000..ec0fc4c --- /dev/null +++ b/include/asm-generic/mmzone.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-generic/mmzone.h + * + * Author: Ganapatrao Kulkarni + * Copyright (C) 2016 Cavium Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _ASM_GENERIC_MMZONE_H +#define _ASM_GENERIC_MMZONE_H + +#if defined(CONFIG_NUMA) || defined(CONFIG_NEED_MULTIPLE_NODES) + +#ifndef NODE_DATA +extern struct pglist_data *node_data[]; +#define NODE_DATA(nid) (node_data[(nid)]) +#endif + +#endif +#endif /* _ASM_GENERIC_MMZONE_H */ -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbcBBKMJ (ORCPT ); Tue, 2 Feb 2016 05:12:09 -0500 Received: from mail-bn1bon0092.outbound.protection.outlook.com ([157.56.111.92]:45730 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbcBBKMD (ORCPT ); Tue, 2 Feb 2016 05:12:03 -0500 Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; From: Ganapatrao Kulkarni To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. Date: Tue, 2 Feb 2016 15:39:23 +0530 Message-ID: <1454407763-1017-9-git-send-email-gkulkarni@caviumnetworks.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0067.INDPRD01.PROD.OUTLOOK.COM (25.163.199.39) To CY1PR0701MB1696.namprd07.prod.outlook.com (25.163.20.30) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;2:SowBaLbMjPGHOc8yUGof3JFOMLxHlV031vVO+0JoA2RngdD4wn2jxLI9C7MU5qwF/Eo/4htnAJmPeqhuU23kRbHkJTbwx+oJXvAFkRMrcRLjTTcrYey6KT7rvJ5zYC7VD43U1hl4p40pvPK2au7YDw==;3:jkv6HZYk9LBDZxmtLvQ8tY7W/ehKrnZWzAtGrhrQ8WNuHL5pzu562JrIg6rJdUEuqPFfS5JkmlwrTgqnzv+mWKJwUzfv7mjkF/RuUl7/JMJp1k/gVz+s+EMkuKlIGnH9;25:uDNWVPzvSDPGzsZO87fRJ8m2KixImST+h4gVq53oh/fv36nJFjEfDij9ARUw+t+UDRl8X4HhJNfPF0CGiex46FLK4wblBablwSwTbY0ymnI7huV9Y+O0SNi8j4oVcGUnd/pnZZe5MBIz3mfXg/avYNrjD9hP8vkDRc+UARk8BmPG8q/jWMftzV34i/b9UzZyJhq5re4QHgWdl6R5CDIO5+nq4CIqDYQiEHSiDffWeAu+4bsflBK/rBckeX9f4J49 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1696; X-MS-Office365-Filtering-Correlation-Id: 9288d479-9652-4a0b-b19e-08d32bb94985 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;20:R0oRhBwpckFiTMMe+PbjWRMnwQs1fBtDgpFI4exYhG1FyDjgWBXL8EdDO6C0kRJyrBviHB6uIGFfscRcxupzHVmM3DJwq7NnRpn3lDT/Zpxy7cWZ7Q4JP+5Xnn/wKNng1urwTCfjL/kDYiqN+G1Umx8Ou5yBMep57WQ6EIqOLtwR+cosy1WzBvG8hyFOKCcNKmPqCx/wGiiLIvFJRedPFxquYwx7bp/89QeVqsAQFMNiF0EvNgwNX64Mn/haw72JrC5ml0VMGOfWcU67VbQzm4LcmKLYkSQ0FsC9bRaCI3JJJTeRV2OsYFYZinxUYJrltIc6XA88pVzZLLTjwo+tkOAqBdB3SSLI2E/bRvwT77vz/+rid+yNOYc6wO7KMq6CZ7XSO9k9lOnRhVxJFwI+aVhdky/BNmXInpLJlQVYp6PjGw+jKSVj/iD0h/t3+IAUT9730LKUhwbGi4FsryAm4r2xFfSQ5d5BmQZwsGyvo/uk8F6wzBTvPTaE+tlveojP9IvK15Hbi9YiMo4JcCHinhvchpI16U9uBaENfmLFv6tz9/Lc+E+rJsfvFaY58yizH088CBGAHfSxlN79jAWa8+3wzCCEWOH3HAQcmSRT/qU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CY1PR0701MB1696;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1696; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;4:nIDsmFD64pmYHEr8a6W9cHRVmJGgcHzxMMsc/gXtgK8jZn55vuWW7YeBLv+CBxda/+9ZS8lpqGneR/inI4y8iBwrjvr9ShBB+TWnv5qCiqoquSRP/2vJ6uDD5QC5C+1IMgGVvAX+V1+8G8XqF+Z1N8GIq37TR2SZ1i8Zkb6JHrRlvYh2NJE2Q8JkgF1YiGtpAEK73oP/AZaya/H+mNsqXyK7v9MVlbBJ+f1JNgyVJN9oUw/+wyvoJarVxYFkejdwsFR5dYq1fKklpyfTN/e69Dv3x/eGgCAXz3L0v0KrHCK3+84HE+Grqzjbmj8ACE1SzOvN6UtJg3H+ToF1QZ/WTgZZKwNz0eSuf/gwb5kHTf1bppeM3WxOqhTFqK9+snmH X-Forefront-PRVS: 084080FC15 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(87976001)(229853001)(2950100001)(47776003)(189998001)(66066001)(76176999)(42186005)(50226001)(19580405001)(77096005)(575784001)(5001770100001)(50986999)(4001450100002)(5004730100002)(92566002)(36756003)(586003)(19580395003)(40100003)(5008740100001)(5009440100003)(6116002)(1096002)(3846002)(3470700001)(5003940100001)(2906002)(50466002)(4326007)(33646002)(2441003)(122386002)(48376002)(2201001)(7099028)(921003)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1696;H:mypc.cavium.com.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1696;23:AKZoIcTH0rGmkY8b0V3u2rF61XT7vU7U+YP68Ne?= =?us-ascii?Q?Cp1QTftgHNA9Veis0l/X6BSLcXyiygSXRUx1DAJN1/vzrK9LiwwgwsVNmUdO?= =?us-ascii?Q?GaLXNYpQqS7MbJcNlusJzdersHrmsOUdPBmQvGHV+WE+nEyDbH07Pm5ou0KF?= =?us-ascii?Q?MtUmcqUqIfELsEFz3rD/IY06JW64PgFW2WrGHlkKkvXj1+HIQKg+2bvZ+pQc?= =?us-ascii?Q?QOVe2p0F0HWYfhzitYrmuUFpewwrwm6jvZKbpJ4RPKtfhn21nBW1QR/JTvhI?= =?us-ascii?Q?Z7MUst9DEzrOryb9y754VBPbzkXwP/hidLT8BNVEjE6ZUOXHrSJVEr1Un+Rp?= =?us-ascii?Q?LgkAXGTlfX/jIAjAPmqmzmjphcG0VEOkNOGC0/plB2uaUXJj0UUmHpvuR247?= =?us-ascii?Q?cgqwabulwMAsJhSvkP6V+PRGipyqGqh0O1wwmhuPGUQMXDs6nsrjAfZ62PZM?= =?us-ascii?Q?q6a6jao2wY53h6nilIZiQSqIclVHlUKjO8dpu47uVBFw1dfgd0J0c5eNzaaJ?= =?us-ascii?Q?P192JV1IdXjoDI5ko5JnzqHGI+NS4FYisp/QzVPtAKkJOhtzYTcctatC73hM?= =?us-ascii?Q?k1P0kY+GuW2eZeb1ZPjxXtsTZf5QL1h6SULWl4fJM2Y+jK39PUbhhaAEqZwO?= =?us-ascii?Q?RMs9wapaAa/ycQjn5Xpf+wMRO0ZEMduWMoL+cSGJeWm9jN832sJVgbUkKVHZ?= =?us-ascii?Q?n/V4/2aXmxudW/u6MOg4ZcO4+XpBLhNuPpQ12qUgt4YfWuplQEsHwBrfMFam?= =?us-ascii?Q?U4gu4twMtl948FPFoqvS1RtahuYyGcodzjkwz1u27Fy0S03M73ZTi2ibrRyL?= =?us-ascii?Q?Yz97UbTUZqktQRwJVAyy1OVDpe6/ZB5nqWn3PR4kfXJmSmogxSN+Bvo03F6M?= =?us-ascii?Q?tUJ5GeMACfJHQGuvUnGIZsJJRzLSTMQPgdUvevHHbnVkeTmFoqqkHOF7sK7p?= =?us-ascii?Q?8kn8e6Tvm2MappqrGyMTXyebNPJOJVcZH9GjYB8o0O+HIY+/l3Gm4fpCbsMT?= =?us-ascii?Q?5E4pIhwCr3KnLZ41/q1mMbXc1QdiT1Te1FtMhaQI+HchQ0N4NjafUKd6yOqD?= =?us-ascii?Q?ljL5fi0opdQqKsjb7aDaYKJixKtw2CFBfwwQDL5kLMAcVQDWxCA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;5:mG5lw1EMrD6PBEfj7BYLhDD0WH38YO5nexbk4t2dkafuA8iZR7NzGk0wMGAWZ5jhVGXmd1/fzCzjWHlfsOzR3UUVJXE26n2Y7hgUeJJuUhD4NuQy/twFOwj2gJtHXeooP4oAuIeggaHdDuRXmkDuVQ==;24:sDTSCUTgZ2qG3soKUNWHT/Y5zbumi+8olj+DYyO3FFujJaH63NVvWO79NxqDrljCJ+mNLGA0ba5CZ+QEFaDujqbmvZb4HFlp+S8JDiFYZOc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2016 10:11:47.1184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1696 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NODE_DATA is defined across multiple asm header files. Moving generic definition to asm-generic/mmzone.h to remove redundant definitions. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/mmzone.h | 4 +--- arch/m32r/include/asm/mmzone.h | 4 +--- arch/metag/include/asm/mmzone.h | 4 +--- arch/powerpc/include/asm/mmzone.h | 8 ++------ arch/s390/include/asm/mmzone.h | 6 +----- arch/sh/include/asm/mmzone.h | 4 +--- arch/sparc/include/asm/mmzone.h | 6 ++---- arch/x86/include/asm/mmzone.h | 3 +-- arch/x86/include/asm/mmzone_32.h | 5 ----- arch/x86/include/asm/mmzone_64.h | 17 ----------------- include/asm-generic/mmzone.h | 24 ++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 51 deletions(-) delete mode 100644 arch/x86/include/asm/mmzone_64.h create mode 100644 include/asm-generic/mmzone.h diff --git a/arch/arm64/include/asm/mmzone.h b/arch/arm64/include/asm/mmzone.h index a0de9e6..611a1cf 100644 --- a/arch/arm64/include/asm/mmzone.h +++ b/arch/arm64/include/asm/mmzone.h @@ -4,9 +4,7 @@ #ifdef CONFIG_NUMA #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[(nid)]) +#include #endif /* CONFIG_NUMA */ #endif /* __ASM_MMZONE_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h index 115ced3..e3d66a0 100644 --- a/arch/m32r/include/asm/mmzone.h +++ b/arch/m32r/include/asm/mmzone.h @@ -7,12 +7,10 @@ #define _ASM_MMZONE_H_ #include +#include #ifdef CONFIG_DISCONTIGMEM -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) diff --git a/arch/metag/include/asm/mmzone.h b/arch/metag/include/asm/mmzone.h index 9c88a9c..b1e95b3 100644 --- a/arch/metag/include/asm/mmzone.h +++ b/arch/metag/include/asm/mmzone.h @@ -3,9 +3,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 7b58917..da0c5ba 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h @@ -19,12 +19,6 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data *node_data[]; -/* - * Return a pointer to the node data for node n. - */ -#define NODE_DATA(nid) (node_data[nid]) - /* * Following are specific to this numa platform. */ @@ -42,5 +36,7 @@ u64 memory_hotplug_max(void); #define memory_hotplug_max() memblock_end_of_DRAM() #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* __KERNEL__ */ #endif /* _ASM_MMZONE_H_ */ diff --git a/arch/s390/include/asm/mmzone.h b/arch/s390/include/asm/mmzone.h index a9e834e..91f1fcc 100644 --- a/arch/s390/include/asm/mmzone.h +++ b/arch/s390/include/asm/mmzone.h @@ -7,10 +7,6 @@ #ifndef _ASM_S390_MMZONE_H #define _ASM_S390_MMZONE_H -#ifdef CONFIG_NUMA +#include -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#endif /* CONFIG_NUMA */ #endif /* _ASM_S390_MMZONE_H */ diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 15a8496..c070d00 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h @@ -5,9 +5,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index 99d9b9f..ef1365b 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h @@ -5,13 +5,11 @@ #include -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - extern int numa_cpu_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[]; #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* _SPARC64_MMZONE_H */ diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h index d497bc4..5a52815 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ #ifdef CONFIG_X86_32 # include -#else -# include #endif +#include diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 1ec990b..09f7cfb 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h @@ -8,11 +8,6 @@ #include -#ifdef CONFIG_NUMA -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_DISCONTIGMEM /* diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h deleted file mode 100644 index 129d9aa..0000000 --- a/arch/x86/include/asm/mmzone_64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* K8 NUMA support */ -/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ -/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef _ASM_X86_MMZONE_64_H -#define _ASM_X86_MMZONE_64_H - -#ifdef CONFIG_NUMA - -#include -#include - -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - -#endif -#endif /* _ASM_X86_MMZONE_64_H */ diff --git a/include/asm-generic/mmzone.h b/include/asm-generic/mmzone.h new file mode 100644 index 0000000..ec0fc4c --- /dev/null +++ b/include/asm-generic/mmzone.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-generic/mmzone.h + * + * Author: Ganapatrao Kulkarni + * Copyright (C) 2016 Cavium Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _ASM_GENERIC_MMZONE_H +#define _ASM_GENERIC_MMZONE_H + +#if defined(CONFIG_NUMA) || defined(CONFIG_NEED_MULTIPLE_NODES) + +#ifndef NODE_DATA +extern struct pglist_data *node_data[]; +#define NODE_DATA(nid) (node_data[(nid)]) +#endif + +#endif +#endif /* _ASM_GENERIC_MMZONE_H */ -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ganapatrao Kulkarni Subject: [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. Date: Tue, 2 Feb 2016 15:39:23 +0530 Message-ID: <1454407763-1017-9-git-send-email-gkulkarni@caviumnetworks.com> References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> Sender: linux-sh-owner@vger.kernel.org List-Archive: List-Post: To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-arch@vger.kernel.org, Will.Deacon@arm.com, catalin.marinas@arm.com, robh+dt@kernel.org, mark.rutland@arm.com, grant.likely@linaro.org, leif.lindholm@linaro.org, rfranz@cavium.com, ard.biesheuvel@linaro.org, msalter@redhat.com, steve.capper@linaro.org, hanjun.guo@linaro.org, al.stone@linaro.org, arnd@arndb.de, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rjw@rjwysocki.net, lenb@kernel.org, marc.zyngier@arm.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, tony.luck@intel.com, fenghua.yu@intel.com, james.hog Cc: gpkulkarni@gmail.com List-ID: NODE_DATA is defined across multiple asm header files. Moving generic definition to asm-generic/mmzone.h to remove redundant definitions. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/mmzone.h | 4 +--- arch/m32r/include/asm/mmzone.h | 4 +--- arch/metag/include/asm/mmzone.h | 4 +--- arch/powerpc/include/asm/mmzone.h | 8 ++------ arch/s390/include/asm/mmzone.h | 6 +----- arch/sh/include/asm/mmzone.h | 4 +--- arch/sparc/include/asm/mmzone.h | 6 ++---- arch/x86/include/asm/mmzone.h | 3 +-- arch/x86/include/asm/mmzone_32.h | 5 ----- arch/x86/include/asm/mmzone_64.h | 17 ----------------- include/asm-generic/mmzone.h | 24 ++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 51 deletions(-) delete mode 100644 arch/x86/include/asm/mmzone_64.h create mode 100644 include/asm-generic/mmzone.h diff --git a/arch/arm64/include/asm/mmzone.h b/arch/arm64/include/asm/mmzone.h index a0de9e6..611a1cf 100644 --- a/arch/arm64/include/asm/mmzone.h +++ b/arch/arm64/include/asm/mmzone.h @@ -4,9 +4,7 @@ #ifdef CONFIG_NUMA #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[(nid)]) +#include #endif /* CONFIG_NUMA */ #endif /* __ASM_MMZONE_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h index 115ced3..e3d66a0 100644 --- a/arch/m32r/include/asm/mmzone.h +++ b/arch/m32r/include/asm/mmzone.h @@ -7,12 +7,10 @@ #define _ASM_MMZONE_H_ #include +#include #ifdef CONFIG_DISCONTIGMEM -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) diff --git a/arch/metag/include/asm/mmzone.h b/arch/metag/include/asm/mmzone.h index 9c88a9c..b1e95b3 100644 --- a/arch/metag/include/asm/mmzone.h +++ b/arch/metag/include/asm/mmzone.h @@ -3,9 +3,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 7b58917..da0c5ba 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h @@ -19,12 +19,6 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data *node_data[]; -/* - * Return a pointer to the node data for node n. - */ -#define NODE_DATA(nid) (node_data[nid]) - /* * Following are specific to this numa platform. */ @@ -42,5 +36,7 @@ u64 memory_hotplug_max(void); #define memory_hotplug_max() memblock_end_of_DRAM() #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* __KERNEL__ */ #endif /* _ASM_MMZONE_H_ */ diff --git a/arch/s390/include/asm/mmzone.h b/arch/s390/include/asm/mmzone.h index a9e834e..91f1fcc 100644 --- a/arch/s390/include/asm/mmzone.h +++ b/arch/s390/include/asm/mmzone.h @@ -7,10 +7,6 @@ #ifndef _ASM_S390_MMZONE_H #define _ASM_S390_MMZONE_H -#ifdef CONFIG_NUMA +#include -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#endif /* CONFIG_NUMA */ #endif /* _ASM_S390_MMZONE_H */ diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 15a8496..c070d00 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h @@ -5,9 +5,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index 99d9b9f..ef1365b 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h @@ -5,13 +5,11 @@ #include -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - extern int numa_cpu_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[]; #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* _SPARC64_MMZONE_H */ diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h index d497bc4..5a52815 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ #ifdef CONFIG_X86_32 # include -#else -# include #endif +#include diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 1ec990b..09f7cfb 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h @@ -8,11 +8,6 @@ #include -#ifdef CONFIG_NUMA -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_DISCONTIGMEM /* diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h deleted file mode 100644 index 129d9aa..0000000 --- a/arch/x86/include/asm/mmzone_64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* K8 NUMA support */ -/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ -/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef _ASM_X86_MMZONE_64_H -#define _ASM_X86_MMZONE_64_H - -#ifdef CONFIG_NUMA - -#include -#include - -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - -#endif -#endif /* _ASM_X86_MMZONE_64_H */ diff --git a/include/asm-generic/mmzone.h b/include/asm-generic/mmzone.h new file mode 100644 index 0000000..ec0fc4c --- /dev/null +++ b/include/asm-generic/mmzone.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-generic/mmzone.h + * + * Author: Ganapatrao Kulkarni + * Copyright (C) 2016 Cavium Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _ASM_GENERIC_MMZONE_H +#define _ASM_GENERIC_MMZONE_H + +#if defined(CONFIG_NUMA) || defined(CONFIG_NEED_MULTIPLE_NODES) + +#ifndef NODE_DATA +extern struct pglist_data *node_data[]; +#define NODE_DATA(nid) (node_data[(nid)]) +#endif + +#endif +#endif /* _ASM_GENERIC_MMZONE_H */ -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn1bon0092.outbound.protection.outlook.com ([157.56.111.92]:45730 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbcBBKMD (ORCPT ); Tue, 2 Feb 2016 05:12:03 -0500 From: Ganapatrao Kulkarni Subject: [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. Date: Tue, 2 Feb 2016 15:39:23 +0530 Message-ID: <1454407763-1017-9-git-send-email-gkulkarni@caviumnetworks.com> In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-arch@vger.kernel.org, Will.Deacon@arm.com, catalin.marinas@arm.com, robh+dt@kernel.org, mark.rutland@arm.com, grant.likely@linaro.org, leif.lindholm@linaro.org, rfranz@cavium.com, ard.biesheuvel@linaro.org, msalter@redhat.com, steve.capper@linaro.org, hanjun.guo@linaro.org, al.stone@linaro.org, arnd@arndb.de, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rjw@rjwysocki.net, lenb@kernel.org, marc.zyngier@arm.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, tony.luck@intel.com, fenghua.yu@intel.com, james.hogan@imgtec.com, benh@kernel.crashing.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, jonathan@jonmasters.org, rrichter@cavium.com, Prasun.Kapoor@caviumnetworks.com Cc: gpkulkarni@gmail.com Message-ID: <20160202100923.FKMmnPHbfhD5ujBN8tqN0lC1Mi0FQP_lcBMmdLs0AUc@z> NODE_DATA is defined across multiple asm header files. Moving generic definition to asm-generic/mmzone.h to remove redundant definitions. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/mmzone.h | 4 +--- arch/m32r/include/asm/mmzone.h | 4 +--- arch/metag/include/asm/mmzone.h | 4 +--- arch/powerpc/include/asm/mmzone.h | 8 ++------ arch/s390/include/asm/mmzone.h | 6 +----- arch/sh/include/asm/mmzone.h | 4 +--- arch/sparc/include/asm/mmzone.h | 6 ++---- arch/x86/include/asm/mmzone.h | 3 +-- arch/x86/include/asm/mmzone_32.h | 5 ----- arch/x86/include/asm/mmzone_64.h | 17 ----------------- include/asm-generic/mmzone.h | 24 ++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 51 deletions(-) delete mode 100644 arch/x86/include/asm/mmzone_64.h create mode 100644 include/asm-generic/mmzone.h diff --git a/arch/arm64/include/asm/mmzone.h b/arch/arm64/include/asm/mmzone.h index a0de9e6..611a1cf 100644 --- a/arch/arm64/include/asm/mmzone.h +++ b/arch/arm64/include/asm/mmzone.h @@ -4,9 +4,7 @@ #ifdef CONFIG_NUMA #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[(nid)]) +#include #endif /* CONFIG_NUMA */ #endif /* __ASM_MMZONE_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h index 115ced3..e3d66a0 100644 --- a/arch/m32r/include/asm/mmzone.h +++ b/arch/m32r/include/asm/mmzone.h @@ -7,12 +7,10 @@ #define _ASM_MMZONE_H_ #include +#include #ifdef CONFIG_DISCONTIGMEM -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) diff --git a/arch/metag/include/asm/mmzone.h b/arch/metag/include/asm/mmzone.h index 9c88a9c..b1e95b3 100644 --- a/arch/metag/include/asm/mmzone.h +++ b/arch/metag/include/asm/mmzone.h @@ -3,9 +3,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 7b58917..da0c5ba 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h @@ -19,12 +19,6 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data *node_data[]; -/* - * Return a pointer to the node data for node n. - */ -#define NODE_DATA(nid) (node_data[nid]) - /* * Following are specific to this numa platform. */ @@ -42,5 +36,7 @@ u64 memory_hotplug_max(void); #define memory_hotplug_max() memblock_end_of_DRAM() #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* __KERNEL__ */ #endif /* _ASM_MMZONE_H_ */ diff --git a/arch/s390/include/asm/mmzone.h b/arch/s390/include/asm/mmzone.h index a9e834e..91f1fcc 100644 --- a/arch/s390/include/asm/mmzone.h +++ b/arch/s390/include/asm/mmzone.h @@ -7,10 +7,6 @@ #ifndef _ASM_S390_MMZONE_H #define _ASM_S390_MMZONE_H -#ifdef CONFIG_NUMA +#include -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#endif /* CONFIG_NUMA */ #endif /* _ASM_S390_MMZONE_H */ diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 15a8496..c070d00 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h @@ -5,9 +5,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index 99d9b9f..ef1365b 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h @@ -5,13 +5,11 @@ #include -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - extern int numa_cpu_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[]; #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* _SPARC64_MMZONE_H */ diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h index d497bc4..5a52815 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ #ifdef CONFIG_X86_32 # include -#else -# include #endif +#include diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 1ec990b..09f7cfb 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h @@ -8,11 +8,6 @@ #include -#ifdef CONFIG_NUMA -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_DISCONTIGMEM /* diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h deleted file mode 100644 index 129d9aa..0000000 --- a/arch/x86/include/asm/mmzone_64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* K8 NUMA support */ -/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ -/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef _ASM_X86_MMZONE_64_H -#define _ASM_X86_MMZONE_64_H - -#ifdef CONFIG_NUMA - -#include -#include - -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - -#endif -#endif /* _ASM_X86_MMZONE_64_H */ diff --git a/include/asm-generic/mmzone.h b/include/asm-generic/mmzone.h new file mode 100644 index 0000000..ec0fc4c --- /dev/null +++ b/include/asm-generic/mmzone.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-generic/mmzone.h + * + * Author: Ganapatrao Kulkarni + * Copyright (C) 2016 Cavium Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _ASM_GENERIC_MMZONE_H +#define _ASM_GENERIC_MMZONE_H + +#if defined(CONFIG_NUMA) || defined(CONFIG_NEED_MULTIPLE_NODES) + +#ifndef NODE_DATA +extern struct pglist_data *node_data[]; +#define NODE_DATA(nid) (node_data[(nid)]) +#endif + +#endif +#endif /* _ASM_GENERIC_MMZONE_H */ -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: gkulkarni@caviumnetworks.com (Ganapatrao Kulkarni) Date: Tue, 2 Feb 2016 15:39:23 +0530 Subject: [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> Message-ID: <1454407763-1017-9-git-send-email-gkulkarni@caviumnetworks.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org NODE_DATA is defined across multiple asm header files. Moving generic definition to asm-generic/mmzone.h to remove redundant definitions. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/mmzone.h | 4 +--- arch/m32r/include/asm/mmzone.h | 4 +--- arch/metag/include/asm/mmzone.h | 4 +--- arch/powerpc/include/asm/mmzone.h | 8 ++------ arch/s390/include/asm/mmzone.h | 6 +----- arch/sh/include/asm/mmzone.h | 4 +--- arch/sparc/include/asm/mmzone.h | 6 ++---- arch/x86/include/asm/mmzone.h | 3 +-- arch/x86/include/asm/mmzone_32.h | 5 ----- arch/x86/include/asm/mmzone_64.h | 17 ----------------- include/asm-generic/mmzone.h | 24 ++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 51 deletions(-) delete mode 100644 arch/x86/include/asm/mmzone_64.h create mode 100644 include/asm-generic/mmzone.h diff --git a/arch/arm64/include/asm/mmzone.h b/arch/arm64/include/asm/mmzone.h index a0de9e6..611a1cf 100644 --- a/arch/arm64/include/asm/mmzone.h +++ b/arch/arm64/include/asm/mmzone.h @@ -4,9 +4,7 @@ #ifdef CONFIG_NUMA #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[(nid)]) +#include #endif /* CONFIG_NUMA */ #endif /* __ASM_MMZONE_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h index 115ced3..e3d66a0 100644 --- a/arch/m32r/include/asm/mmzone.h +++ b/arch/m32r/include/asm/mmzone.h @@ -7,12 +7,10 @@ #define _ASM_MMZONE_H_ #include +#include #ifdef CONFIG_DISCONTIGMEM -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) diff --git a/arch/metag/include/asm/mmzone.h b/arch/metag/include/asm/mmzone.h index 9c88a9c..b1e95b3 100644 --- a/arch/metag/include/asm/mmzone.h +++ b/arch/metag/include/asm/mmzone.h @@ -3,9 +3,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 7b58917..da0c5ba 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h @@ -19,12 +19,6 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data *node_data[]; -/* - * Return a pointer to the node data for node n. - */ -#define NODE_DATA(nid) (node_data[nid]) - /* * Following are specific to this numa platform. */ @@ -42,5 +36,7 @@ u64 memory_hotplug_max(void); #define memory_hotplug_max() memblock_end_of_DRAM() #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* __KERNEL__ */ #endif /* _ASM_MMZONE_H_ */ diff --git a/arch/s390/include/asm/mmzone.h b/arch/s390/include/asm/mmzone.h index a9e834e..91f1fcc 100644 --- a/arch/s390/include/asm/mmzone.h +++ b/arch/s390/include/asm/mmzone.h @@ -7,10 +7,6 @@ #ifndef _ASM_S390_MMZONE_H #define _ASM_S390_MMZONE_H -#ifdef CONFIG_NUMA +#include -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#endif /* CONFIG_NUMA */ #endif /* _ASM_S390_MMZONE_H */ diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 15a8496..c070d00 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h @@ -5,9 +5,7 @@ #ifdef CONFIG_NEED_MULTIPLE_NODES #include - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) +#include static inline int pfn_to_nid(unsigned long pfn) { diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index 99d9b9f..ef1365b 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h @@ -5,13 +5,11 @@ #include -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - extern int numa_cpu_lookup_table[]; extern cpumask_t numa_cpumask_lookup_table[]; #endif /* CONFIG_NEED_MULTIPLE_NODES */ +#include + #endif /* _SPARC64_MMZONE_H */ diff --git a/arch/x86/include/asm/mmzone.h b/arch/x86/include/asm/mmzone.h index d497bc4..5a52815 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ #ifdef CONFIG_X86_32 # include -#else -# include #endif +#include diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 1ec990b..09f7cfb 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h @@ -8,11 +8,6 @@ #include -#ifdef CONFIG_NUMA -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_DISCONTIGMEM /* diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h deleted file mode 100644 index 129d9aa..0000000 --- a/arch/x86/include/asm/mmzone_64.h +++ /dev/null @@ -1,17 +0,0 @@ -/* K8 NUMA support */ -/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ -/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef _ASM_X86_MMZONE_64_H -#define _ASM_X86_MMZONE_64_H - -#ifdef CONFIG_NUMA - -#include -#include - -extern struct pglist_data *node_data[]; - -#define NODE_DATA(nid) (node_data[nid]) - -#endif -#endif /* _ASM_X86_MMZONE_64_H */ diff --git a/include/asm-generic/mmzone.h b/include/asm-generic/mmzone.h new file mode 100644 index 0000000..ec0fc4c --- /dev/null +++ b/include/asm-generic/mmzone.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-generic/mmzone.h + * + * Author: Ganapatrao Kulkarni + * Copyright (C) 2016 Cavium Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _ASM_GENERIC_MMZONE_H +#define _ASM_GENERIC_MMZONE_H + +#if defined(CONFIG_NUMA) || defined(CONFIG_NEED_MULTIPLE_NODES) + +#ifndef NODE_DATA +extern struct pglist_data *node_data[]; +#define NODE_DATA(nid) (node_data[(nid)]) +#endif + +#endif +#endif /* _ASM_GENERIC_MMZONE_H */ -- 1.8.1.4