All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/9] x86-64 untangle smp.h vs thread_info
Date: Tue, 29 Nov 2005 23:21:37 -0500	[thread overview]
Message-ID: <20051130042137.GD19112@kvack.org> (raw)

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

                 reply	other threads:[~2005-11-30  4:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051130042137.GD19112@kvack.org \
    --to=bcrl@kvack.org \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.