From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ganapatrao Kulkarni Date: Tue, 02 Feb 2016 10:21:22 +0000 Subject: [PATCH v10 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files. Message-Id: <1454407763-1017-8-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 At present cpumask_of_pcibus is defined for !CONFIG_NUMA and moving out to common will allow to use for numa too. This also avoids redefinition of this macro in respective architecture header files. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/topology.h | 3 --- arch/ia64/include/asm/topology.h | 4 ---- arch/metag/include/asm/topology.h | 3 --- arch/powerpc/include/asm/topology.h | 4 ---- arch/s390/include/asm/pci.h | 2 +- arch/s390/include/asm/topology.h | 1 + arch/sh/include/asm/topology.h | 3 --- arch/tile/include/asm/pci.h | 2 -- arch/tile/include/asm/topology.h | 3 +++ arch/x86/include/asm/pci.h | 2 +- arch/x86/include/asm/topology.h | 1 + include/asm-generic/topology.h | 4 ++-- 12 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339..6e1f62c 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,9 +26,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu); struct pci_bus; int pcibus_to_node(struct pci_bus *bus); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif /* CONFIG_NUMA */ diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ad8f69..2778eb6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -58,10 +58,6 @@ void build_cpu_to_node_map(void); extern void arch_fix_phys_package_id(int num, u32 slot); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h index e95f874..b285196 100644 --- a/arch/metag/include/asm/topology.h +++ b/arch/metag/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..eee025d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -32,10 +32,6 @@ static inline int pcibus_to_node(struct pci_bus *bus) } #endif -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c873e68..539fb2d 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -205,7 +205,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6b53962..ac2f88f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -78,6 +78,7 @@ static inline const struct cpumask *cpumask_of_node(int node) #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index b0a282d..357983d 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index dfedd7a..473ed46 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -223,8 +223,6 @@ static inline int pcibios_assign_all_busses(void) /* Minimum PCI I/O address, starting at the page boundary. */ #define PCIBIOS_MIN_IO PAGE_SIZE -/* Use any cpu for PCI. */ -#define cpumask_of_pcibus(bus) cpu_online_mask /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index b11d5fc..9770b86 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -46,6 +46,9 @@ static inline const struct cpumask *cpumask_of_node(int node) #endif /* CONFIG_NUMA */ +/* Use any cpu for PCI. */ +#define cpumask_of_pcibus(bus) cpu_online_mask + #include #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4625943..4a6f358 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -121,7 +121,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { int node; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 0fb4648..980f6ee 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -91,6 +91,7 @@ extern void setup_node_to_cpumask_map(void); #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index fc824e2..ee305f1 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* !CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) = -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem -- 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 S1754739AbcBBKL4 (ORCPT ); Tue, 2 Feb 2016 05:11:56 -0500 Received: from mail-bn1bon0065.outbound.protection.outlook.com ([157.56.111.65]:30944 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbcBBKLv (ORCPT ); Tue, 2 Feb 2016 05:11:51 -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 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files. Date: Tue, 2 Feb 2016 15:39:22 +0530 Message-ID: <1454407763-1017-8-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:KVMxIUMqZH+TP2T1c26ysWZv1PPoh44aWWWi72C/u6e8AHw/T4Bv/Dgp0xsqRmS8a8P/7zhaiV4xoShQdvdWkty9ynKWmrO7hfnjVgbb2mI793RCkBvnKbqpr9lAkiPx+rtpGER+O+3OfPutZB/LTg==;3:Ylu4AG76pEZ/ijdBKykGf0PyWESAuRzOJjdZyRWGU2RUvyGcmxVG/nKPjhMjDS04UevEdLnf0QGtLFkR2IKtgYg/hILlEhco32Dm8QRPGLx8Hf99MxxVbbh4WWt7qpkA;25:qgJwLHKcWMdJvK4HCGoJB0kCxIyH89olWZdXdjBcToBXN9gxWnE/Bs+cgngRPWd5nUxsGrdDKjwQpuWz/mNU/zkBNi7D2FR+VYBkPisuND2EV6akQVzOYsCgwJqjfxmBVuQ4+YBjddHigsXWO8iD46fLMA6X5LM/Z4Re3yafhOB/F6IDDuu0p+WHAIxFQXLGBkyVnfQWLlcVdHOndjHEq6y3zuh2LRqjAoPRFUj97Y1aCqH69q1/RFRJ5MLhHBw2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1696; X-MS-Office365-Filtering-Correlation-Id: 9bcceb94-46bc-48d6-1bef-08d32bb941ec X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;20:wN0OtFSSLgXPktrd9E6Pwgt5UFReRBYu3LPmmKep+GW0/fCVVEzRISxCxu7DsDhHKkPDFPo0gNvsUgjtz2odGerbf9djowcBqfEA5ktFzOdUmf3iwwm2wXOLF6gTE4L71E14f8Sj3HZNUMgJpCR3pf0bVy3NrwsNuORV2G0z/SxTEQiLXGKz5p5vazUmUNBv8RBXaPvPp3daNxOZC4a8IY+2MQEixKlOleYQ/EjEjeLIXxsXh9LPprUFEe3oxivUm8Ke8c5SCA2MrIO4eGPyyLaIPDeazi0n1avBNVw00RDXfXVG7CZ+U2QZ8+Thd+Kd5TDB+87WQppa8kE/TrzvxH0WOTjaTsqW4ymufDxGvsknA8AfVlT3yKiFCOHI5rRfMfuko5JmkW0U0X5qbWxTI9qA/zlplbqGb/AOe/fOceCPjz7oqYOTGxwMNilzqc4eqA+DuYzhZDbnHb38TAl38VD5T36ikyNtRs1SBMOFzsMnIw2eYOEOmVnuukM6lEWvGlvJWZvChO7f1exd/27WFlTO697Dpq6VsDuFF3Nq/vR+hltvqCF+AU7UVxzctfJhMleGwlOt2aCodDNh0XbbCuaL09u7cc/yDH1MN+bNoUs= 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:qXa5qHrr8mWa7OjM1DcCRISt1dSMTvCLzOChTM6f6NATdP4xSKnc8lycUGUgEovt7+G0ZAhr8ZZbyNOrF8zWAAIZaB+bicJRp6lTSGAvRMgg5lAM36DKZQrseREoirpzhZaRS0GW5jlzTENzAPnH4uYck7g+6s/dkXaB0YAeALJzbS+xwc5sUemKsCTRlLB3psDvM5nNWBPHeuNAbLauLxwbPW0rsnjNmpvJ7B/HKkeOyHsthyb8NdfZC0IKT2C7F/AGDrZJOAmdaZ+sg4iMY/bUzky+Dk0m07uerP8X20DEEIUOyQKFz1zY13j1IA4t+k40ASi4QvpEAmQqUPrWrq7FR0Lu8wutXWj05RRgfIMUa6C1e+ptyAG3ZZdQfMiX 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:1aIc1fPir8NtXQomfWVjEe52SZqus17j2MHoy8g?= =?us-ascii?Q?zqK6Gews7FmOPOZmkNZKqdS2StUwUmYncOCB18GTn2Vpqr2Ro3oukX+Y9OcY?= =?us-ascii?Q?a9gS7/Tdb9FVnT7S1QmzN0t6JcYCpDcBKrD2SIV9KP8n1dETv4NZ++girV/C?= =?us-ascii?Q?riiz0/xWpfQs26hy4H64etk8Xbs0PE/1plXiJl6MihDINIFHLNJAdyEXhqvy?= =?us-ascii?Q?bzr+3Stfw+k6Bhhm59AYItg6HSnWCvpD/bVexjRFaf8tQYkpBFKyaRW7ycjY?= =?us-ascii?Q?O5OESERyH055GyWs7hSXz5sIhIr3QwnTwQzjDKcAXVENGfDbnsVHMEG1KJwJ?= =?us-ascii?Q?Ml76pVp5rW/sz605ELuxQserwIAfjtoQwz4Aix4F+6As/9ZHJ2vCFbxFyjvk?= =?us-ascii?Q?KHjs42gZp7+WUYla7KVqDIn6a+fkDKyhw/DN1kuvbY7yESWFkYciwmY4dJqN?= =?us-ascii?Q?+DW/Euhe3qvVe/G6AcIy42wEYKdJUdTIIQ/fg6Mt39b1mtbe4yLmVMSaUyk7?= =?us-ascii?Q?dt+ZRyEdlPsvz9OA+2zSs/xJ2coaljlQM+l3TullDHNVH84APWAO4JfJ53y9?= =?us-ascii?Q?zkTabE0+2Fd42xm684VMBXck8JKf6NiwZhlO1yB17Iq9yoI8xsLLqDPtJh8w?= =?us-ascii?Q?ZnYHke4vQtg+vcBfFCRZ8YI5tITeDggchGl0TeXqx9WMPaRhlU7uvkjGg6I6?= =?us-ascii?Q?pcqDapgFpt7wpTzpYcGpU1TJaQsL4uzdsCxgKVePjJyk+8uKTdleoiiaiyce?= =?us-ascii?Q?UfhMxrd8u3IMzYpGuK2ZdeYj8s4dhpRK/qFQUvQlPJESiOvjinyjWQCcSHD/?= =?us-ascii?Q?K5/wXBLfSzYHfQOylvHAdVL1mwWpIxEITMN6uKGZRfZdYNnhcupi9U8egkm3?= =?us-ascii?Q?FPqhJVYUt6lwd1L2GlHzyXEgyOTZ6WRiWhWca+Lqb2hxKZBBiZhIGy5UyY2t?= =?us-ascii?Q?DzLIX9favL24Dpi7HcKbk0RLzHKAzW3/eGz7CCcUex0a/go8MmJDf49pnBYP?= =?us-ascii?Q?eK4sfAL3/n4XocL4Y0o2gja7E+pAeJMMum1LErU1R0sZ74G9oVPs11UYlH1i?= =?us-ascii?Q?BsgjpdSJZTcOmETQBerbjNLNvPEZefC8m4IQOc2Xk604iGSvIYA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1696;5:XA71kOgMs/rbIkb/N7lpww9K6+Ypx+jLMLnuIQ11lL6ehiVr/XWjw7QhR9E7DL7wiE0cMhrrNcFfeMxqo8wKBAXUyl220L+ktOlc8G17RiodtIJXppUB3S1aiVrTIZnTNlhfPtPziJLpkD3opBzahw==;24:Mdhdz8Xp/6meNNe1NMU3/BvJdOIiczDkmw1ok1fFCyT5hBmVQu57k0peB9vzhmcE0KzMYfcQjnVWyyG7dj4yfTOunlu/7XpjFb+m9tqPpHA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2016 10:11:34.2271 (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 At present cpumask_of_pcibus is defined for !CONFIG_NUMA and moving out to common will allow to use for numa too. This also avoids redefinition of this macro in respective architecture header files. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/topology.h | 3 --- arch/ia64/include/asm/topology.h | 4 ---- arch/metag/include/asm/topology.h | 3 --- arch/powerpc/include/asm/topology.h | 4 ---- arch/s390/include/asm/pci.h | 2 +- arch/s390/include/asm/topology.h | 1 + arch/sh/include/asm/topology.h | 3 --- arch/tile/include/asm/pci.h | 2 -- arch/tile/include/asm/topology.h | 3 +++ arch/x86/include/asm/pci.h | 2 +- arch/x86/include/asm/topology.h | 1 + include/asm-generic/topology.h | 4 ++-- 12 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339..6e1f62c 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,9 +26,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu); struct pci_bus; int pcibus_to_node(struct pci_bus *bus); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif /* CONFIG_NUMA */ diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ad8f69..2778eb6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -58,10 +58,6 @@ void build_cpu_to_node_map(void); extern void arch_fix_phys_package_id(int num, u32 slot); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h index e95f874..b285196 100644 --- a/arch/metag/include/asm/topology.h +++ b/arch/metag/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..eee025d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -32,10 +32,6 @@ static inline int pcibus_to_node(struct pci_bus *bus) } #endif -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c873e68..539fb2d 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -205,7 +205,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6b53962..ac2f88f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -78,6 +78,7 @@ static inline const struct cpumask *cpumask_of_node(int node) #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index b0a282d..357983d 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index dfedd7a..473ed46 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -223,8 +223,6 @@ static inline int pcibios_assign_all_busses(void) /* Minimum PCI I/O address, starting at the page boundary. */ #define PCIBIOS_MIN_IO PAGE_SIZE -/* Use any cpu for PCI. */ -#define cpumask_of_pcibus(bus) cpu_online_mask /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index b11d5fc..9770b86 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -46,6 +46,9 @@ static inline const struct cpumask *cpumask_of_node(int node) #endif /* CONFIG_NUMA */ +/* Use any cpu for PCI. */ +#define cpumask_of_pcibus(bus) cpu_online_mask + #include #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4625943..4a6f358 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -121,7 +121,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { int node; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 0fb4648..980f6ee 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -91,6 +91,7 @@ extern void setup_node_to_cpumask_map(void); #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index fc824e2..ee305f1 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* !CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ganapatrao Kulkarni Subject: [PATCH v10 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files. Date: Tue, 2 Feb 2016 15:39:22 +0530 Message-ID: <1454407763-1017-8-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-arch-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: At present cpumask_of_pcibus is defined for !CONFIG_NUMA and moving out to common will allow to use for numa too. This also avoids redefinition of this macro in respective architecture header files. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/topology.h | 3 --- arch/ia64/include/asm/topology.h | 4 ---- arch/metag/include/asm/topology.h | 3 --- arch/powerpc/include/asm/topology.h | 4 ---- arch/s390/include/asm/pci.h | 2 +- arch/s390/include/asm/topology.h | 1 + arch/sh/include/asm/topology.h | 3 --- arch/tile/include/asm/pci.h | 2 -- arch/tile/include/asm/topology.h | 3 +++ arch/x86/include/asm/pci.h | 2 +- arch/x86/include/asm/topology.h | 1 + include/asm-generic/topology.h | 4 ++-- 12 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339..6e1f62c 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,9 +26,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu); struct pci_bus; int pcibus_to_node(struct pci_bus *bus); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif /* CONFIG_NUMA */ diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ad8f69..2778eb6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -58,10 +58,6 @@ void build_cpu_to_node_map(void); extern void arch_fix_phys_package_id(int num, u32 slot); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h index e95f874..b285196 100644 --- a/arch/metag/include/asm/topology.h +++ b/arch/metag/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..eee025d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -32,10 +32,6 @@ static inline int pcibus_to_node(struct pci_bus *bus) } #endif -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c873e68..539fb2d 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -205,7 +205,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6b53962..ac2f88f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -78,6 +78,7 @@ static inline const struct cpumask *cpumask_of_node(int node) #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index b0a282d..357983d 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index dfedd7a..473ed46 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -223,8 +223,6 @@ static inline int pcibios_assign_all_busses(void) /* Minimum PCI I/O address, starting at the page boundary. */ #define PCIBIOS_MIN_IO PAGE_SIZE -/* Use any cpu for PCI. */ -#define cpumask_of_pcibus(bus) cpu_online_mask /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index b11d5fc..9770b86 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -46,6 +46,9 @@ static inline const struct cpumask *cpumask_of_node(int node) #endif /* CONFIG_NUMA */ +/* Use any cpu for PCI. */ +#define cpumask_of_pcibus(bus) cpu_online_mask + #include #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4625943..4a6f358 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -121,7 +121,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { int node; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 0fb4648..980f6ee 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -91,6 +91,7 @@ extern void setup_node_to_cpumask_map(void); #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index fc824e2..ee305f1 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* !CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn1bon0065.outbound.protection.outlook.com ([157.56.111.65]:30944 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbcBBKLv (ORCPT ); Tue, 2 Feb 2016 05:11:51 -0500 From: Ganapatrao Kulkarni Subject: [PATCH v10 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files. Date: Tue, 2 Feb 2016 15:39:22 +0530 Message-ID: <1454407763-1017-8-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: <20160202100922.OBTdPuyl_xo1AbyCPqOmfR8VzoO4jDisqNKi4Qn_tnM@z> At present cpumask_of_pcibus is defined for !CONFIG_NUMA and moving out to common will allow to use for numa too. This also avoids redefinition of this macro in respective architecture header files. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/topology.h | 3 --- arch/ia64/include/asm/topology.h | 4 ---- arch/metag/include/asm/topology.h | 3 --- arch/powerpc/include/asm/topology.h | 4 ---- arch/s390/include/asm/pci.h | 2 +- arch/s390/include/asm/topology.h | 1 + arch/sh/include/asm/topology.h | 3 --- arch/tile/include/asm/pci.h | 2 -- arch/tile/include/asm/topology.h | 3 +++ arch/x86/include/asm/pci.h | 2 +- arch/x86/include/asm/topology.h | 1 + include/asm-generic/topology.h | 4 ++-- 12 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339..6e1f62c 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,9 +26,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu); struct pci_bus; int pcibus_to_node(struct pci_bus *bus); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif /* CONFIG_NUMA */ diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ad8f69..2778eb6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -58,10 +58,6 @@ void build_cpu_to_node_map(void); extern void arch_fix_phys_package_id(int num, u32 slot); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h index e95f874..b285196 100644 --- a/arch/metag/include/asm/topology.h +++ b/arch/metag/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..eee025d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -32,10 +32,6 @@ static inline int pcibus_to_node(struct pci_bus *bus) } #endif -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c873e68..539fb2d 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -205,7 +205,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6b53962..ac2f88f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -78,6 +78,7 @@ static inline const struct cpumask *cpumask_of_node(int node) #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index b0a282d..357983d 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index dfedd7a..473ed46 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -223,8 +223,6 @@ static inline int pcibios_assign_all_busses(void) /* Minimum PCI I/O address, starting at the page boundary. */ #define PCIBIOS_MIN_IO PAGE_SIZE -/* Use any cpu for PCI. */ -#define cpumask_of_pcibus(bus) cpu_online_mask /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index b11d5fc..9770b86 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -46,6 +46,9 @@ static inline const struct cpumask *cpumask_of_node(int node) #endif /* CONFIG_NUMA */ +/* Use any cpu for PCI. */ +#define cpumask_of_pcibus(bus) cpu_online_mask + #include #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4625943..4a6f358 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -121,7 +121,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { int node; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 0fb4648..980f6ee 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -91,6 +91,7 @@ extern void setup_node_to_cpumask_map(void); #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index fc824e2..ee305f1 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* !CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem -- 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:22 +0530 Subject: [PATCH v10 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in 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-8-git-send-email-gkulkarni@caviumnetworks.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org At present cpumask_of_pcibus is defined for !CONFIG_NUMA and moving out to common will allow to use for numa too. This also avoids redefinition of this macro in respective architecture header files. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/topology.h | 3 --- arch/ia64/include/asm/topology.h | 4 ---- arch/metag/include/asm/topology.h | 3 --- arch/powerpc/include/asm/topology.h | 4 ---- arch/s390/include/asm/pci.h | 2 +- arch/s390/include/asm/topology.h | 1 + arch/sh/include/asm/topology.h | 3 --- arch/tile/include/asm/pci.h | 2 -- arch/tile/include/asm/topology.h | 3 +++ arch/x86/include/asm/pci.h | 2 +- arch/x86/include/asm/topology.h | 1 + include/asm-generic/topology.h | 4 ++-- 12 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339..6e1f62c 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,9 +26,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu); struct pci_bus; int pcibus_to_node(struct pci_bus *bus); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif /* CONFIG_NUMA */ diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ad8f69..2778eb6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -58,10 +58,6 @@ void build_cpu_to_node_map(void); extern void arch_fix_phys_package_id(int num, u32 slot); -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h index e95f874..b285196 100644 --- a/arch/metag/include/asm/topology.h +++ b/arch/metag/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..eee025d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -32,10 +32,6 @@ static inline int pcibus_to_node(struct pci_bus *bus) } #endif -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c873e68..539fb2d 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -205,7 +205,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { return cpu_online_mask; } diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 6b53962..ac2f88f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -78,6 +78,7 @@ static inline const struct cpumask *cpumask_of_node(int node) #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) #define node_distance(a, b) __node_distance(a, b) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index b0a282d..357983d 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -9,9 +9,6 @@ #define cpumask_of_node(node) ((void)node, cpu_online_mask) #define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) #endif diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index dfedd7a..473ed46 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -223,8 +223,6 @@ static inline int pcibios_assign_all_busses(void) /* Minimum PCI I/O address, starting at the page boundary. */ #define PCIBIOS_MIN_IO PAGE_SIZE -/* Use any cpu for PCI. */ -#define cpumask_of_pcibus(bus) cpu_online_mask /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index b11d5fc..9770b86 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -46,6 +46,9 @@ static inline const struct cpumask *cpumask_of_node(int node) #endif /* CONFIG_NUMA */ +/* Use any cpu for PCI. */ +#define cpumask_of_pcibus(bus) cpu_online_mask + #include #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4625943..4a6f358 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -121,7 +121,7 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) } static inline const struct cpumask * -cpumask_of_pcibus(const struct pci_bus *bus) +__cpumask_of_pcibus(const struct pci_bus *bus) { int node; diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 0fb4648..980f6ee 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -91,6 +91,7 @@ extern void setup_node_to_cpumask_map(void); #define parent_node(node) (node) #define pcibus_to_node(bus) __pcibus_to_node(bus) +#define cpumask_of_pcibus(bus) __cpumask_of_pcibus(bus) extern int __node_distance(int, int); #define node_distance(a, b) __node_distance(a, b) diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index fc824e2..ee305f1 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -54,14 +54,14 @@ #define pcibus_to_node(bus) ((void)(bus), -1) #endif +#endif /* !CONFIG_NUMA */ + #ifndef cpumask_of_pcibus #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ cpu_all_mask : \ cpumask_of_node(pcibus_to_node(bus))) #endif -#endif /* CONFIG_NUMA */ - #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES) #ifndef set_numa_mem -- 1.8.1.4