Re: [PATCH] net/core/flow.c CONFIG_SMP Fix in flow_cache_flush(void)



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@xxxxxxxxx>
diff --git a/include/linux/smp.h b/include/linux/smp.hindex 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


Relevant Pages

  • [git pull] scheduler updates for v2.6.27, phase #2
    ... CPU hotplug interaction) and Peter's hrtick cleanup (which fixes the ... +static inline void rebuild_sched_domains ... ifdef CONFIG_FTRACE ...
    (Linux-Kernel)
  • [git pull] scheduler changes for v2.6.27
    ... use a 2-d bitmap for searching lowest-pri CPU ... fix SCHED_OTHER balance iterator to include all tasks ... #ifdef CONFIG_SCHEDSTATS ...
    (Linux-Kernel)
  • Re: [build fix] Re: [GIT PATCH] SCSI part 1
    ... that wont work - a better replacement fix is the one below. ... Then i looked at the commit and it said that it was created just ... So i didnt even think of it having hit linux-next so i didnt look into ... +#ifdef CONFIG_BLOCK ...
    (Linux-Kernel)
  • [PATCH] x86 syscall.h: fix argument order
    ... Petr wrote a patch to fix that, and I've amended it to fix the same braino ... # ifdef CONFIG_IA32_EMULATION ...
    (Linux-Kernel)
  • Re: random.c changes for sparse irq_desc are crap
    ... Failure to find an irq descriptor in ... broken driver that's throwing around meaningless irq vectors. ... Please fix this up. ... we still end up with an ifdef in the .c ...
    (Linux-Kernel)