lkml.org 
[lkml]   [2007]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Define smp_call_function_mask() on uniprocessor builds
Andrew Morton wrote:
> On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity <avi@qumranet.com> wrote:
>
>
>> 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.
>>
>> Signed-off-by: Avi Kivity <avi@qumranet.com>
>>
>> diff --git a/include/linux/smp.h b/include/linux/smp.h
>> index 259a13c..24e2e31 100644
>> --- a/include/linux/smp.h
>> +++ b/include/linux/smp.h
>> @@ -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.
>
>

Right. Ingo sent a patch which does this.

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

> 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.

--
error compiling committee.c: too many arguments to function

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-24 16:57    [W:0.045 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site