From patchwork Thu Feb 25 00:02:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8415071 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 5CF1F9F372 for ; Thu, 25 Feb 2016 00:05:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A957202EB for ; Thu, 25 Feb 2016 00:05:01 +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 3FCED202E6 for ; Thu, 25 Feb 2016 00:05:00 +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 1aYjP5-00030C-Q5; Thu, 25 Feb 2016 00:03:35 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYjOg-0002WH-3Z for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2016 00:03:11 +0000 Received: by mail-pf0-x22d.google.com with SMTP id c10so22515053pfc.2 for ; Wed, 24 Feb 2016 16:02:49 -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=hispR17YzVVlgz0ijuNXdZ/vAixYOItFAKK7OU6gv7k=; b=jOvQyo/fgCJ36hv++jw3kXTNq77Gzb0333BziXdIANDwOyrBEX3Or2V5DofL+COY1Z A+vQ10ScE01EKCnU2ulGl+Twky3ZEFrw3nSrZjuXIi0gQq/2gX6H+fWZmwMLwHXd1Fof GP7cyTEx/wqhoTjQYKC2MIsQuJTA73/NlplMeme9F7qaU8xkmI85CJaZMWZlWu8wwcDj AwoDHjDve5asS2JbZS2LitfGnPb/22qeW5iCmdDOrw830rMStGtGlkYMTWiEGAi581m9 fw6zvR6kOr0RK+DcCuS9QDhlv1dc2nxcsuiw8oqAVT6QgDC8dQ6mSUXX77oMjR+vuqc/ 57Sg== 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=hispR17YzVVlgz0ijuNXdZ/vAixYOItFAKK7OU6gv7k=; b=hurTNmWWWgrkpOLa5xP1Mcy/ptS75YrEK/v7PcsyqvmI/p8CCOhg1s6I6Ww1u5mysW 10DtbwaYf514q7l2JW+uYOZ4BnNx4AQxE5ILUQafhDUcJqxVa0M7M6ayg++4z1a94KlY IbKBVctwCXL+FVboz5KENpu1Wf+EB5fjFI0uwiQSDXfVcvXKrBZaDd6yopWe1Q3Jxriw D9kEnZz90OWxXGmMzWYRwIe42HcRFciNs/IVLFbAqodl9OtlFBEiawSL12hmKVcDbOEd FUez+95KB0fpnog1Kc9ZZah/7V3TJFDUNerl+o9mfTcMkcAjMI5zNWkk+C7V3XLYJA/R ETdA== X-Gm-Message-State: AG10YORYMyK3kfq1zwiFgk4jDFI0/Nkanm5HmDMaMgpMP5EP5VeLb9fMqAc3UVPQXuFIpQ== X-Received: by 10.98.8.74 with SMTP id c71mr59467838pfd.155.1456358569389; Wed, 24 Feb 2016 16:02:49 -0800 (PST) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id s90sm7464392pfa.49.2016.02.24.16.02.45 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Feb 2016 16:02:45 -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 u1P02i60024255; Wed, 24 Feb 2016 16:02:44 -0800 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u1P02ifU024254; Wed, 24 Feb 2016 16:02:44 -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 1/2] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files. Date: Wed, 24 Feb 2016 16:02:07 -0800 Message-Id: <1456358528-24213-2-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_160310_244896_FD0DCD7A X-CRM114-Status: GOOD ( 15.92 ) 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 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 Signed-off-by: David Daney Acked-by: Will Deacon --- 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