Skip to contentSkip to conversation

Define smp_call_function_mask() on uniprocessor builds

PATCH In review Avi Kivity 2 participants 3 messages Oct 24, 2007 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 Define smp_call_function_mask() on uniprocessor builds

Rather than #ifdef users of smp_call_function_mask(), define it as an empty macro to avoid build errors. The function explicitly prohibits callers from specifying the current cpu, so nothing needs to be done.

This unbreaks uniprocessor KVM builds.

include/linux/smp.h +3 -0
index 259a13c..24e2e31 100644
@@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
 	0;			\
 })
 
+#define smp_call_function_mask(mask, func, info, wait) \
+	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
+
 #endif /* !SMP */
 
 /*
#1 lore raw
Quoted 13 lines · On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity…

Rather than #ifdef users of smp_call_function_mask(), define it as an empty macro to avoid build errors. The function explicitly prohibits callers from specifying the current cpu, so nothing needs to be done.

This unbreaks uniprocessor KVM builds.

include/linux/smp.h +0 -0
index 259a13c..24e2e31 100644

include/linux/smp.h static inline void smp_send_reschedule(int cpu) { } · line 116

Quoted 9 lines
include/linux/smp.h +3 -0
@@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
 	0;			\
 })
 
+#define smp_call_function_mask(mask, func, info, wait) \
+	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
+
 #endif /* !SMP */
 
 /*

The real smp_call_function_mask() returns int, so this version should do so also.

An inlined C function will provide the needed references to the arguments - no need for those funny (void) thingies. And it will provide typechecking.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

author
#2 lore raw
Quoted 24 lines · Andrew Morton
Quoted 21 lines · On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity…

Rather than #ifdef users of smp_call_function_mask(), define it as an empty macro to avoid build errors. The function explicitly prohibits callers from specifying the current cpu, so nothing needs to be done.

This unbreaks uniprocessor KVM builds.

include/linux/smp.h +3 -0
index 259a13c..24e2e31 100644
@@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
 	0;			\
 })
 
+#define smp_call_function_mask(mask, func, info, wait) \
+	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
+
 #endif /* !SMP */
 
Quoted 7 lines

include/linux/smp.h static inline void smp_send_reschedule(int cpu) { } · line 116

Quoted 2 lines
include/linux/smp.h +0 -0
 /*

The real smp_call_function_mask() returns int, so this version should do so also.

Right. Ingo sent a patch which does this.

[I can't think of a way to use that int though]

Quoted 3 lines

An inlined C function will provide the needed references to the arguments - no need for those funny (void) thingies. And it will provide typechecking.

Last time I did this (on smp_call_function_single()), the build broke on a zillion-and-a-half archs due to include file hell. That got patched into a macro. I saw the cpumask_t in there and got cold feet.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/