All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	Ralf Baechle <ralf@linux-mips.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linux390@de.ibm.com, x86@kernel.org
Subject: Re: [PATCH] atomic64_test: Simplify the #ifdef for atomic64_dec_if_positive() test
Date: Wed, 18 Jul 2012 15:10:37 -0700	[thread overview]
Message-ID: <20120718151037.4692fa85.akpm@linux-foundation.org> (raw)
In-Reply-To: <1342545048-30958-1-git-send-email-catalin.marinas@arm.com>

On Tue, 17 Jul 2012 18:10:48 +0100
Catalin Marinas <catalin.marinas@arm.com> wrote:

> This patch introduces CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE and uses
> this instead of the multitude of #if defined() checks in atomic64_test.c
> 
> ...
>
> --- a/lib/atomic64_test.c
> +++ b/lib/atomic64_test.c
> @@ -114,8 +114,7 @@ static __init int test_atomic64(void)
>  	r += one;
>  	BUG_ON(v.counter != r);
>  
> -#if defined(CONFIG_X86) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \
> -    defined(CONFIG_S390) || defined(_ASM_GENERIC_ATOMIC64_H) || defined(CONFIG_ARM)

ugh, good riddance.

> +#ifdef CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

The alternative way of doing this is to do

#define atomic64_dec_if_positive atomic64_dec_if_positive

in all the relevant .h files, then use #ifdef atomic64_dec_if_positive.
That's rather nice because it keeps everything in one place.  otoh it
is rather unobvious trickery.

But either way is better than what we have now.

      reply	other threads:[~2012-07-18 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 17:10 [PATCH] atomic64_test: Simplify the #ifdef for atomic64_dec_if_positive() test Catalin Marinas
2012-07-18 22:10 ` Andrew Morton [this message]

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=20120718151037.4692fa85.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=linux@arm.linux.org.uk \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=x86@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.