Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755310AbYJCE4U (ORCPT ); Fri, 3 Oct 2008 00:56:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752126AbYJCE4K (ORCPT ); Fri, 3 Oct 2008 00:56:10 -0400 Received: from tomts13.bellnexxia.net ([209.226.175.34]:51521 "EHLO tomts13-srv.bellnexxia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbYJCE4J (ORCPT ); Fri, 3 Oct 2008 00:56:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAHg/5UhMQWq+/2dsb2JhbACBcbo0gWg Date: Fri, 3 Oct 2008 00:56:07 -0400 From: Mathieu Desnoyers To: Steven Rostedt , Ingo Molnar Cc: Linus Torvalds , Peter Zijlstra , Jonathan Corbet , LKML , Thomas Gleixner , Andrew Morton , prasad@linux.vnet.ibm.com, "Frank Ch. Eigler" , David Wilder , hch@lst.de, Martin Bligh , Christoph Hellwig , Masami Hiramatsu , Steven Rostedt , Arnaldo Carvalho de Melo Subject: [PATCH] x86 Topology cpu_to_node parameter check Message-ID: <20081003045607.GA5940@Krystal> References: <1222790072.24384.21.camel@twins> <20081002085030.GF26084@elte.hu> <20081002085145.GA3202@elte.hu> <20081002090517.GA8708@elte.hu> <20081002093835.GA17699@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: X-Editor: vi X-Info: http://krystal.dyndns.org:8080 X-Operating-System: Linux/2.6.21.3-grsec (i686) X-Uptime: 00:54:23 up 120 days, 9:34, 8 users, load average: 0.09, 0.24, 0.24 User-Agent: Mutt/1.5.16 (2007-06-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 40 Declare NUMA-less cpu_to_node with a check that the cpu parameter exists so people without NUMA test configs (namely Steven Rostedt and myself who ran into this error both in the same day with different implementations) stop doing this trivial mistake. Signed-off-by: Mathieu Desnoyers CC: Steven Rostedt CC: Linus Torvalds CC: Peter Zijlstra CC: Andrew Morton CC: Ingo Molnar --- include/asm-x86/topology.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6-lttng/include/asm-x86/topology.h =================================================================== --- linux-2.6-lttng.orig/include/asm-x86/topology.h 2008-10-03 00:37:05.000000000 -0400 +++ linux-2.6-lttng/include/asm-x86/topology.h 2008-10-03 00:45:52.000000000 -0400 @@ -182,9 +182,9 @@ extern int __node_distance(int, int); #else /* !CONFIG_NUMA */ -#define numa_node_id() 0 -#define cpu_to_node(cpu) 0 -#define early_cpu_to_node(cpu) 0 +#define numa_node_id() 0 +#define cpu_to_node(cpu) ((void)(cpu),0) +#define early_cpu_to_node(cpu) cpu_to_node(cpu) static inline const cpumask_t *_node_to_cpumask_ptr(int node) { -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/