xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jennifer Herbert <jennifer.herbert@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCHv2 1/4] atomic: replace atomic_compareandswap() with atomic_cmpxchg()
Date: Tue, 26 Jan 2016 17:09:40 +0000	[thread overview]
Message-ID: <1453828180.25257.48.camel@citrix.com> (raw)
In-Reply-To: <1453825513-1611-2-git-send-email-david.vrabel@citrix.com>

On Tue, 2016-01-26 at 16:25 +0000, David Vrabel wrote:
> atomic_compareandswap() used atomic_t as the new, old and returned
> values which is less convinient than using just int.

"convenient"

> diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h
> index 5a38c67..29ab265 100644
> --- a/xen/include/asm-arm/atomic.h
> +++ b/xen/include/asm-arm/atomic.h
> @@ -138,14 +138,6 @@ static inline void _atomic_set(atomic_t *v, int i)
>  # error "unknown ARM variant"
>  #endif
>  
> -static inline atomic_t atomic_compareandswap(
> -    atomic_t old, atomic_t new, atomic_t *v)
> -{
> -    atomic_t rc;
> -    rc.counter = __cmpxchg(&v->counter, old.counter, new.counter,
> sizeof(int));
> -    return rc;
> -}


Acked-by: Ian Campbell <ian.campbell@citrix.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-01-26 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 16:25 [PATCHv2 0/4] spinlock: queue read-write locks David Vrabel
2016-01-26 16:25 ` [PATCHv2 1/4] atomic: replace atomic_compareandswap() with atomic_cmpxchg() David Vrabel
2016-01-26 17:09   ` Ian Campbell [this message]
2016-01-26 16:25 ` [PATCHv2 2/4] spinlock: shrink struct lock_debug David Vrabel
2016-01-26 16:25 ` [PATCHv2 3/4] spinlock: move rwlock API and per-cpu rwlocks into their own files David Vrabel
2016-01-26 16:25 ` [PATCHv2 4/4] spinlock: fair read-write locks David Vrabel

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=1453828180.25257.48.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jennifer.herbert@citrix.com \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).