All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] smp_call_function_single() should be a macro on UP
@ 2007-07-17 21:29 Al Viro
  2007-07-17 21:40 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2007-07-17 21:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Avi Kivity

... or we end up with header include order problems from hell.
E.g. on m68k this is 100% fatal - local_irq_enable() there
wants preempt_count(), which wants task_struct fields, which
we won't have when we are in smp.h pulled from sched.h.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 8039dac..259a13c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -7,7 +7,6 @@
  */
 
 #include <linux/errno.h>
-#include <asm/system.h>
 
 extern void cpu_idle(void);
 
@@ -100,15 +99,14 @@ static inline int up_smp_call_function(void)
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()			1
 #define smp_prepare_boot_cpu()			do {} while (0)
-static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
-					   void *info, int retry, int wait)
-{
-	WARN_ON(cpuid != 0);
-	local_irq_disable();
-	func(info);
-	local_irq_enable();
-	return 0;
-}
+#define smp_call_function_single(cpuid, func, info, retry, wait) \
+({ \
+	WARN_ON(cpuid != 0);	\
+	local_irq_disable();	\
+	(func)(info);		\
+	local_irq_enable();	\
+	0;			\
+})
 
 #endif /* !SMP */
 

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

end of thread, other threads:[~2007-07-18  0:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17 21:29 [PATCH] smp_call_function_single() should be a macro on UP Al Viro
2007-07-17 21:40 ` David Miller
2007-07-17 23:54   ` Ben Dooks
2007-07-18  0:00     ` Al Viro
2007-07-18  0:07     ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.