]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
atomic64_test: simplify the #ifdef for atomic64_dec_if_positive() test
authorCatalin Marinas <catalin.marinas@arm.com>
Sat, 21 Jul 2012 00:54:59 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:53:21 +0000 (13:53 +1000)
Introduce CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE and use this instead
of the multitude of #if defined() checks in atomic64_test.c

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm/Kconfig
arch/mips/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/x86/Kconfig
lib/Kconfig
lib/atomic64_test.c

index e329d1da3a628a1ad8b902a9ae16a33e4a6c9583..683a6b39fd23462550e5763294cb27c099227ccb 100644 (file)
@@ -11,6 +11,7 @@ config ARM
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
index 61e14594d33840e715b89923574b6d546917fa2d..eba8c48ab7f1a655acc0308ca533ea577768a7ab 100644 (file)
@@ -20,6 +20,7 @@ config MIPS
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
        select RTC_LIB if !MACH_LOONGSON
        select GENERIC_ATOMIC64 if !64BIT
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_DMA_ATTRS
        select HAVE_DMA_API_DEBUG
        select HAVE_GENERIC_HARDIRQS
index 9a5d3cdc3e12f16e3dcbd2060e214dbc8ef23881..4f681b78dd8b0140dc7a3f7cff1ebeb566c6f566 100644 (file)
@@ -115,6 +115,7 @@ config PPC
        select HAVE_OPROFILE
        select HAVE_SYSCALL_WRAPPERS if PPC64
        select GENERIC_ATOMIC64 if PPC32
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
        select HAVE_REGS_AND_STACK_ACCESS_API
index a39b4690c171621e78e2183c6b1b97bd25f4afaf..64cb682e63ff56cf2ca3c3c22229610a632cb885 100644 (file)
@@ -121,6 +121,7 @@ config S390
        select GENERIC_TIME_VSYSCALL
        select GENERIC_CLOCKEVENTS
        select KTIME_SCALAR if 32BIT
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
index 94de2c507be1d5fd34159ab0e52114ffbf50491b..58e6c2e97517f135be58fd6f0df5d9928d40c34d 100644 (file)
@@ -95,6 +95,7 @@ config X86
        select KTIME_SCALAR if X86_32
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 
 config INSTRUCTION_DECODER
        def_bool (KPROBES || PERF_EVENTS || UPROBES)
index bfdbb1ff0aa39db058be3933b725d0737cd1f7b6..bb94c1ba616a4213bc11521adef4310387032353 100644 (file)
@@ -340,6 +340,9 @@ config NLATTR
 config GENERIC_ATOMIC64
        bool
 
+config ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+       def_bool y if GENERIC_ATOMIC64
+
 config LRU_CACHE
        tristate
 
index cb99b91c3a1d3af01b012fc421d69c8935733556..00bca223d1e1e6552bbdd0dd7c69fef2ff48c60d 100644 (file)
@@ -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)
+#ifdef CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        INIT(onestwos);
        BUG_ON(atomic64_dec_if_positive(&v) != (onestwos - 1));
        r -= one;
@@ -129,7 +128,7 @@ static __init int test_atomic64(void)
        BUG_ON(atomic64_dec_if_positive(&v) != (-one - one));
        BUG_ON(v.counter != r);
 #else
-#warning Please implement atomic64_dec_if_positive for your architecture, and add it to the IF above
+#warning Please implement atomic64_dec_if_positive for your architecture and select the above Kconfig symbol
 #endif
 
        INIT(onestwos);