All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: arnd@arndb.de
Cc: Jonas Bonn <jonas@southpole.se>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 1/1] asm-generic: move cmpxchg*_local defs to cmpxchg.h
Date: Tue, 12 Mar 2013 13:35:48 +0100	[thread overview]
Message-ID: <513F2124.6060504@southpole.se> (raw)
In-Reply-To: <1362030843-25354-1-git-send-email-jonas@southpole.se>

Hi Arnd,

Can you comment on this patch?  This is needed so that the generic 
asm/cmpxchg.h can be used standalone (i.e. without pulling in atomic.h). 
  OpenRISC uses the generic asm/cmpxchg.h and things currently don't 
build without this since linux/llist.h now includes asm/cmpxchg.h 
standalone.

Thanks,
Jonas

On 02/28/2013 06:54 AM, Jonas Bonn wrote:
> asm/cmpxchg.h can be included on its own and needs to be self-consistent.
> The definitions for the cmpxchg*_local macros, as such, need to be part
> of this file.
>
> This fixes a build issue on OpenRISC since the system.h smashing patch
> 96f951edb1f1bdbbc99b0cd458f9808bb83d58ae that introdued the direct inclusion
> asm/cmpxchg.h into linux/llist.h.
>
> CC: David Howells <dhowells@redhat.com>
> Signed-off-by: Jonas Bonn <jonas@southpole.se>
> ---
>   include/asm-generic/atomic.h  |    6 ------
>   include/asm-generic/cmpxchg.h |   10 ++++++++++
>   2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
> index 1ced641..33bd2de 100644
> --- a/include/asm-generic/atomic.h
> +++ b/include/asm-generic/atomic.h
> @@ -136,12 +136,6 @@ static inline void atomic_dec(atomic_t *v)
>   #define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
>   #define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))
>
> -#define cmpxchg_local(ptr, o, n)				  	       \
> -	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
> -			(unsigned long)(n), sizeof(*(ptr))))
> -
> -#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
> -
>   static inline int __atomic_add_unless(atomic_t *v, int a, int u)
>   {
>     int c, old;
> diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h
> index 1488302..811fb1e 100644
> --- a/include/asm-generic/cmpxchg.h
> +++ b/include/asm-generic/cmpxchg.h
> @@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
>    */
>   #include <asm-generic/cmpxchg-local.h>
>
> +#ifndef cmpxchg_local
> +#define cmpxchg_local(ptr, o, n)				  	       \
> +	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
> +			(unsigned long)(n), sizeof(*(ptr))))
> +#endif
> +
> +#ifndef cmpxchg64_local
> +#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
> +#endif
> +
>   #define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))
>   #define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n))
>
>

  reply	other threads:[~2013-03-12 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  5:54 [PATCH 1/1] asm-generic: move cmpxchg*_local defs to cmpxchg.h Jonas Bonn
2013-03-12 12:35 ` Jonas Bonn [this message]
2013-03-12 13:05   ` Arnd Bergmann

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=513F2124.6060504@southpole.se \
    --to=jonas@southpole.se \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --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.