public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 3/4] tst_atomic: add atomic_add_return for x86/64, ppc/64 and s390/x
Date: Fri, 15 Apr 2016 08:08:44 -0400 (EDT)	[thread overview]
Message-ID: <2021746918.1819347.1460722124804.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160414143622.GC22998@rei.suse.cz>





----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Thursday, 14 April, 2016 4:36:23 PM
> Subject: Re: [LTP] [PATCH v2 3/4] tst_atomic: add atomic_add_return for x86/64, ppc/64 and s390/x
> 
> Hi!
> >  #if HAVE_SYNC_ADD_AND_FETCH == 1
> > +#define HAVE_ATOMIC_ADD_RETURN 1
> >  static inline __attribute__((always_inline)) int atomic_add_return(int i,
> >  int *v)
> >  {
> >  	return __sync_add_and_fetch(v, i);
> >  }
> > -#else
> > +
> > +#else /* HAVE_SYNC_ADD_AND_FETCH == 1 */
> > +
> > +#if defined(__i386__) || defined(__x86_64__)
> > +#define HAVE_ATOMIC_ADD_RETURN 1
> > +static inline __attribute__((always_inline)) int atomic_add_return(int i,
> > int *v)
> > +{
> 
> Maybe we can make the ifdefs a bit more readable by indenting them with
> spaces after the hash.
> 
> #else
> # if defined(__i386__) || defined(__x86_64__)
> #  define HAVE_ATOMIC_ADD_RETURN 1
> 
> ...
> 
> # endif

I have re-arranged this in v3, so that there is less nesting,
and also dropped HAVE_ATOMIC_ADD_RETURN.

I also made some other small tweaks, changes are described
in each patch.


  reply	other threads:[~2016-04-15 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  8:59 [LTP] [PATCH v2 1/4] tst_atomic: make tst_atomic_inc take a signed integer Jan Stancek
2016-04-14  8:59 ` [LTP] [PATCH v2 2/4] m4: add a check for __sync_add_and_fetch Jan Stancek
2016-04-14 14:33   ` Cyril Hrubis
2016-04-14  8:59 ` [LTP] [PATCH v2 3/4] tst_atomic: add atomic_add_return for x86/64, ppc/64 and s390/x Jan Stancek
2016-04-14 14:36   ` Cyril Hrubis
2016-04-15 12:08     ` Jan Stancek [this message]
2016-04-14  8:59 ` [LTP] [PATCH v2 4/4] tst_atomic: add test for tst_atomic_inc Jan Stancek
2016-04-14 14:43   ` Cyril Hrubis
2016-04-14 14:37 ` [LTP] [PATCH v2 1/4] tst_atomic: make tst_atomic_inc take a signed integer Cyril Hrubis

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=2021746918.1819347.1460722124804.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /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