From patchwork Thu Feb 25 00:02:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8415081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C14819F372 for ; Thu, 25 Feb 2016 00:05:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9ED062034A for ; Thu, 25 Feb 2016 00:05:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EEA2202EB for ; Thu, 25 Feb 2016 00:05:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYjPI-00039R-Q8; Thu, 25 Feb 2016 00:03:48 +0000 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYjOh-0002Wd-TZ for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2016 00:03:15 +0000 Received: by mail-pf0-x231.google.com with SMTP id x65so21779254pfb.1 for ; Wed, 24 Feb 2016 16:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3xwcS6V16V0dzWhUXEnPru9E5vgFlEWGQQlgQQwc8sc=; b=gIddPA6z8aaIkY+yEpTxxqnlfDs/0IR/mFYf9bEV0tUL+LrUCcbOG/rehmgm4jeXFF 9dw1brpPa/TrW6w65I7fSGx458CcvZpRtZU6rjDNxCQeaqcI8VDe/SGkkVzU7DdrnZs8 gijRvrEtPIXEntjTZffezIxiWv8/CjSa1l/WWnMjk9X7r+Ohytff/7NVEYP/XEyYUEfS Q5da0lz1ptoBHBMIzOJq1YMO9h2Wbr3ft5sUxg4XhbgS6baKT1GKnkQjoZSC/ZhD360C J1aBqoGjlJ0FgQEtIL/QmpvtU3XUN0nqy4n61PHXeIIZNXcAhUREp1XRajrbJ2FmUIfX Mwkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3xwcS6V16V0dzWhUXEnPru9E5vgFlEWGQQlgQQwc8sc=; b=HFpiC+X2s18dXLw861dIwwQzN8v7OeWYS14igDPmujaPKisT+eF0bOcrH4dHlL8cSr xXLlNO7rmJemeUNDlRfUY4czg6gdFi5r+IGgQar9JBhLw6maKSBSAXSzi0+LwG+XBxwq bgTkPlTDgVS/6p5wSXu5ej2WaRIG0X1qQVxTLF41gTEf9jW2yKrcnxjMHnK0wrk0VU6r o80BKSMwPQ+CXY7pyTR1Gkf6At+rh01n5cTAOEzrV9HxXR/0luHlp88tYVsdtVn5Sj5U GAoUiK/DpKrwzMqzYAknRyWaNm833Kr0EcEdNBhULWJv+iPKYq7Ao4qAIwaoW44KOT7l t2Ng== X-Gm-Message-State: AG10YORHjMGQQRBJsE7MMzr+XCu5zoizSd95Uo+aiELBjrkXgT+t7kmbZJwP2A8JRoN3Ng== X-Received: by 10.98.0.84 with SMTP id 81mr59103546pfa.67.1456358571188; Wed, 24 Feb 2016 16:02:51 -0800 (PST) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id e20sm7483780pfd.4.2016.02.24.16.02.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Feb 2016 16:02:49 -0800 (PST) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u1P02jX1024259; Wed, 24 Feb 2016 16:02:45 -0800 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u1P02jXc024258; Wed, 24 Feb 2016 16:02:45 -0800 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Rutland , Catalin Marinas , Tony Luck , Fenghua Yu , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , "David S. Miller" , Chris Metcalf , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Arnd Bergmann , 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, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 2/2] numa, mm, cleanup: remove redundant NODE_DATA macro from asm header files. Date: Wed, 24 Feb 2016 16:02:08 -0800 Message-Id: <1456358528-24213-3-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1456358528-24213-1-git-send-email-ddaney.cavm@gmail.com> References: <1456358528-24213-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_160312_219005_C0263D2D X-CRM114-Status: GOOD ( 18.50 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ganapatrao Kulkarni , linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ganapatrao Kulkarni 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 Signed-off-by: David Daney --- 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..8b9a0c2 100644 --- a/arch/x86/include/asm/mmzone.h +++ b/arch/x86/include/asm/mmzone.h @@ -1,5 +1,4 @@ +#include #ifdef CONFIG_X86_32 # include -#else -# include #endif 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 */