All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Avi Kivity <avi@qumranet.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	jeff@garzik.org, bunk@kernel.org
Subject: Re: [PATCH] Define smp_call_function_mask() on uniprocessor builds
Date: Wed, 24 Oct 2007 07:43:54 -0700	[thread overview]
Message-ID: <20071024074354.9edd4cee.akpm@linux-foundation.org> (raw)
In-Reply-To: <11932158852325-git-send-email-avi@qumranet.com>

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.

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



WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	bunk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Linus Torvalds
	<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jeff-o2qLIJkoznsdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH] Define smp_call_function_mask() on uniprocessor builds
Date: Wed, 24 Oct 2007 07:43:54 -0700	[thread overview]
Message-ID: <20071024074354.9edd4cee.akpm@linux-foundation.org> (raw)
In-Reply-To: <11932158852325-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
> 
> 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.

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/

  reply	other threads:[~2007-10-24 14:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24  8:51 [PATCH] Define smp_call_function_mask() on uniprocessor builds Avi Kivity
2007-10-24  8:51 ` Avi Kivity
2007-10-24 14:43 ` Andrew Morton [this message]
2007-10-24 14:43   ` Andrew Morton
2007-10-24 14:54   ` Avi Kivity
2007-10-24 14:54     ` Avi Kivity

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=20071024074354.9edd4cee.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=avi@qumranet.com \
    --cc=bunk@kernel.org \
    --cc=jeff@garzik.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.