summaryrefslogtreecommitdiff
path: root/lib/atomic64_test.c
AgeCommit message (Collapse)Author
2014-06-04lib/atomic64_test.c: convert printk(KERN_INFO to pr_infoFabian Frederick
Convert printk to current pr_foo() logging functions. Also add pr_fmt based on KBUILD_MODNAME to avoid repeating prefix. Prefix is now "atomic64_test: " Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Luca Barbieri <luca@luca-barbieri.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-30atomic64_test: simplify the #ifdef for atomic64_dec_if_positive() testCatalin Marinas
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-02-29bug.h: add include of it to various implicit C usersPaul Gortmaker
With bug.h currently living right in linux/kernel.h there are files that use BUG_ON and friends but are not including the header explicitly. Fix them up so we can remove the presence in kernel.h file. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-07-26atomic: use <linux/atomic.h>Arun Sharma
This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <asharma@fb.com> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Miller <davem@davemloft.net> Cc: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-07-27ARM: 6213/1: atomic64_test: add ARM as supported architectureWill Deacon
ARM has support for the atomic64_dec_if_positive operation so ensure that it is tested by the atomic64_test routine. Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-06-04lib: add s390 to atomic64_dec_if_positive archsHeiko Carstens
Add s390 to list of architectures that have atomic64_dec_if_positive implemented so we get rid of this warning: lib/atomic64_test.c:129:2: warning: #warning Please implement atomic64_dec_if_positive for your architecture, and add it to the IF above Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Luca Barbieri <luca@luca-barbieri.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-24lib/atomic64_test: fix missing include of linux/kernel.hPeter Huewe
Fix a build-failure (http://kisskb.ellerman.id.au/kisskb/buildresult/2601239/) by adding the missing include file (linux/kernel.h) for printk and KERN_INFO. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> LKML-Reference: <201005241913.o4OJDKdf010884@imap1.linux-foundation.org> Cc: Luca Barbieri <luca@luca-barbieri.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-03-01x86, atomic64: In selftest, distinguish x86-64 from 586+H. Peter Anvin
The x86-64 implementation of the atomics is totally different from the i586+ implementation, which makes it quite confusing to call it "586+". Also fix indentation, and add "i" for "i386" and "i586" as used elsewhere in the kernel. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267005265-27958-4-git-send-email-luca@luca-barbieri.com>
2010-03-01lib: Fix atomic64_inc_not_zero testLuca Barbieri
atomic64_inc_not_zero must return 1 if it perfomed the add and 0 otherwise. The test assumed the opposite convention. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267469749-11878-5-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-03-01lib: Fix atomic64_add_unless testLuca Barbieri
atomic64_add_unless must return 1 if it perfomed the add and 0 otherwise. The test assumed the opposite convention. Reported-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267469749-11878-2-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-03-01x86: Implement atomic[64]_dec_if_positive()Luca Barbieri
Add support for atomic_dec_if_positive(), and atomic64_dec_if_positive() for x86-64. atomic64_dec_if_positive() for x86-32 was already implemented in a previous patch. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267183361-20775-2-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-03-01lib: Only test atomic64_dec_if_positive on archs having itLuca Barbieri
Currently atomic64_dec_if_positive() is only supported by PowerPC, MIPS and x86-32. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267183361-20775-1-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-02-25lib: Add self-test for atomic64_tLuca Barbieri
This patch adds self-test on boot code for atomic64_t. This has been used to test the later changes in this patchset. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> LKML-Reference: <1267005265-27958-4-git-send-email-luca@luca-barbieri.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>