[PATCH 3/9] x86-64 untangle smp.h vs thread_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Similar to the include dependancy in seccomp.h, an inline function in
smp.h introduces messy ordering requirements on thread_info by way of
using an inline function instead of macro.  Convert on_each_cpu to a
macro in order to avoid a big include mess.

---

 include/linux/smp.h |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

applies-to: a156afeaa4d82cdc6ac938c8c06b35d55a65e7fa
887d01c129bdf271901064625b1a01e5dbfc3e0f
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9dfa3ee..a341b4d 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -57,19 +57,20 @@ extern int smp_call_function (void (*fun
 			      int retry, int wait);
 
 /*
- * Call a function on all processors
+ * Call a function on all processors.
+ * This needs to be a macro to allow for arch specific dependances on 
+ * sched.h in preempt_*().
  */
-static inline int on_each_cpu(void (*func) (void *info), void *info,
-			      int retry, int wait)
-{
-	int ret = 0;
-
-	preempt_disable();
-	ret = smp_call_function(func, info, retry, wait);
-	func(info);
-	preempt_enable();
-	return ret;
-}
+#define on_each_cpu(func, info, retry, wait)			\
+({								\
+	int ret = 0;						\
+								\
+	preempt_disable();					\
+	ret = smp_call_function(func, info, retry, wait);	\
+	func(info);						\
+	preempt_enable();					\
+	ret;							\
+})
 
 #define MSG_ALL_BUT_SELF	0x8000	/* Assume <32768 CPU's */
 #define MSG_ALL			0x8001
---
0.99.9.GIT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux