linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void)
@ 2006-01-28 12:44 Ashutosh Naik
  2006-01-28 14:43 ` Patrick McHardy
  2006-01-28 19:00 ` David S. Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ashutosh Naik @ 2006-01-28 12:44 UTC (permalink / raw)
  To: linux-kernel, davem, kuznet, Andrew Morton, linux-net

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

This patch fixes a warning in the function flow_cache_flush(), where
the the function smp_call_function is entered even when CONFIG_SMP is
not defined

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 456 bytes --]

--- /usr/src/linux-2.6.16-rc1/net/core/flow.c.orig	2006-01-28 18:00:48.000000000 +0530
+++ /usr/src/linux-2.6.16-rc1/net/core/flow.c	2006-01-28 18:02:16.000000000 +0530
@@ -296,7 +296,9 @@ void flow_cache_flush(void)
 	init_completion(&info.completion);
 
 	local_bh_disable();
+#ifdef CONFIG_SMP
 	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
+#endif /* CONFIG_SMP */
 	flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void)
  2006-01-28 12:44 [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void) Ashutosh Naik
@ 2006-01-28 14:43 ` Patrick McHardy
  2006-01-28 19:00 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2006-01-28 14:43 UTC (permalink / raw)
  To: Ashutosh Naik; +Cc: linux-kernel, davem, kuznet, Andrew Morton, linux-net

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]

Ashutosh Naik wrote:
> This patch fixes a warning in the function flow_cache_flush(), where
> the the function smp_call_function is entered even when CONFIG_SMP is
> not defined
> 
> --- /usr/src/linux-2.6.16-rc1/net/core/flow.c.orig	2006-01-28 18:00:48.000000000 +0530
> +++ /usr/src/linux-2.6.16-rc1/net/core/flow.c	2006-01-28 18:02:16.000000000 +0530
> @@ -296,7 +296,9 @@ void flow_cache_flush(void)
>  	init_completion(&info.completion);
>  
>  	local_bh_disable();
> +#ifdef CONFIG_SMP
>  	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
> +#endif /* CONFIG_SMP */

A better fix is to change smp_call_function, so you don't have to
add ifdefs to all users.

Signed-off-by: Patrick McHardy <kaber@trash.net>

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 542 bytes --]

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9dfa3ee..86b5065 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -94,7 +94,7 @@ void smp_prepare_boot_cpu(void);
  */
 #define raw_smp_processor_id()			0
 #define hard_smp_processor_id()			0
-#define smp_call_function(func,info,retry,wait)	({ 0; })
+#define smp_call_function(func,info,retry,wait)	({ int x = 0; x; })
 #define on_each_cpu(func,info,retry,wait)	({ func(info); 0; })
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()			1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void)
  2006-01-28 12:44 [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void) Ashutosh Naik
  2006-01-28 14:43 ` Patrick McHardy
@ 2006-01-28 19:00 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2006-01-28 19:00 UTC (permalink / raw)
  To: ashutosh.naik; +Cc: linux-kernel, davem, kuznet, akpm, linux-net

From: Ashutosh Naik <ashutosh.naik@gmail.com>
Date: Sat, 28 Jan 2006 18:14:37 +0530

> This patch fixes a warning in the function flow_cache_flush(), where
> the the function smp_call_function is entered even when CONFIG_SMP is
> not defined
> 
> Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

There was a long thread about how to fix this problem
properly on linux-kernel a month or two ago.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-28 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-28 12:44 [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void) Ashutosh Naik
2006-01-28 14:43 ` Patrick McHardy
2006-01-28 19:00 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).