[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120718151037.4692fa85.akpm@linux-foundation.org>
Date: Wed, 18 Jul 2012 15:10:37 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Catalin Marinas <catalin.marinas@....com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Russell King <linux@....linux.org.uk>,
Ralf Baechle <ralf@...ux-mips.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>, linux390@...ibm.com,
x86@...nel.org
Subject: Re: [PATCH] atomic64_test: Simplify the #ifdef for
atomic64_dec_if_positive() test
On Tue, 17 Jul 2012 18:10:48 +0100
Catalin Marinas <catalin.marinas@....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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists