diff options
author | Arun Sharma <asharma@fb.com> | 2011-07-26 19:09:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:47 -0400 |
commit | 60063497a95e716c9a689af3be2687d261f115b4 (patch) | |
tree | 6ce0d68db76982c53df46aee5f29f944ebf2c320 /arch/tile | |
parent | 148817ba092f9f6edd35bad3c6c6b8e8f90fe2ed (diff) |
atomic: use <linux/atomic.h>
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>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/include/asm/atomic.h | 9 | ||||
-rw-r--r-- | arch/tile/include/asm/atomic_32.h | 4 | ||||
-rw-r--r-- | arch/tile/include/asm/atomic_64.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/bitops_32.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/bitops_64.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/spinlock_32.h | 2 | ||||
-rw-r--r-- | arch/tile/kernel/intvec_32.S | 2 | ||||
-rw-r--r-- | arch/tile/lib/atomic_32.c | 2 | ||||
-rw-r--r-- | arch/tile/lib/atomic_asm_32.S | 2 |
9 files changed, 9 insertions, 18 deletions
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index 739cfe0499d1..e3272715c3cb 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h | |||
@@ -121,15 +121,6 @@ static inline int atomic_read(const atomic_t *v) | |||
121 | */ | 121 | */ |
122 | #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) | 122 | #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) |
123 | 123 | ||
124 | /** | ||
125 | * atomic_inc_not_zero - increment unless the number is zero | ||
126 | * @v: pointer of type atomic_t | ||
127 | * | ||
128 | * Atomically increments @v by 1, so long as @v is non-zero. | ||
129 | * Returns non-zero if @v was non-zero, and zero otherwise. | ||
130 | */ | ||
131 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
132 | |||
133 | /* Nonexistent functions intended to cause link errors. */ | 124 | /* Nonexistent functions intended to cause link errors. */ |
134 | extern unsigned long __xchg_called_with_bad_pointer(void); | 125 | extern unsigned long __xchg_called_with_bad_pointer(void); |
135 | extern unsigned long __cmpxchg_called_with_bad_pointer(void); | 126 | extern unsigned long __cmpxchg_called_with_bad_pointer(void); |
diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h index 92a8bee32311..246feed4794d 100644 --- a/arch/tile/include/asm/atomic_32.h +++ b/arch/tile/include/asm/atomic_32.h | |||
@@ -11,7 +11,7 @@ | |||
11 | * NON INFRINGEMENT. See the GNU General Public License for | 11 | * NON INFRINGEMENT. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * Do not include directly; use <asm/atomic.h>. | 14 | * Do not include directly; use <linux/atomic.h>. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef _ASM_TILE_ATOMIC_32_H | 17 | #ifndef _ASM_TILE_ATOMIC_32_H |
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
23 | 23 | ||
24 | /* Tile-specific routines to support <asm/atomic.h>. */ | 24 | /* Tile-specific routines to support <linux/atomic.h>. */ |
25 | int _atomic_xchg(atomic_t *v, int n); | 25 | int _atomic_xchg(atomic_t *v, int n); |
26 | int _atomic_xchg_add(atomic_t *v, int i); | 26 | int _atomic_xchg_add(atomic_t *v, int i); |
27 | int _atomic_xchg_add_unless(atomic_t *v, int a, int u); | 27 | int _atomic_xchg_add_unless(atomic_t *v, int a, int u); |
diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h index 1c1e60d8ccb6..a48dda30cbcc 100644 --- a/arch/tile/include/asm/atomic_64.h +++ b/arch/tile/include/asm/atomic_64.h | |||
@@ -11,7 +11,7 @@ | |||
11 | * NON INFRINGEMENT. See the GNU General Public License for | 11 | * NON INFRINGEMENT. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * Do not include directly; use <asm/atomic.h>. | 14 | * Do not include directly; use <linux/atomic.h>. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef _ASM_TILE_ATOMIC_64_H | 17 | #ifndef _ASM_TILE_ATOMIC_64_H |
diff --git a/arch/tile/include/asm/bitops_32.h b/arch/tile/include/asm/bitops_32.h index d31ab905cfa7..571b118bfd9b 100644 --- a/arch/tile/include/asm/bitops_32.h +++ b/arch/tile/include/asm/bitops_32.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #define _ASM_TILE_BITOPS_32_H | 16 | #define _ASM_TILE_BITOPS_32_H |
17 | 17 | ||
18 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #include <asm/system.h> | 20 | #include <asm/system.h> |
21 | 21 | ||
22 | /* Tile-specific routines to support <asm/bitops.h>. */ | 22 | /* Tile-specific routines to support <asm/bitops.h>. */ |
diff --git a/arch/tile/include/asm/bitops_64.h b/arch/tile/include/asm/bitops_64.h index 68f8c5bc0679..e9c8e381ee0e 100644 --- a/arch/tile/include/asm/bitops_64.h +++ b/arch/tile/include/asm/bitops_64.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #define _ASM_TILE_BITOPS_64_H | 16 | #define _ASM_TILE_BITOPS_64_H |
17 | 17 | ||
18 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #include <asm/system.h> | 20 | #include <asm/system.h> |
21 | 21 | ||
22 | /* See <asm/bitops.h> for API comments. */ | 22 | /* See <asm/bitops.h> for API comments. */ |
diff --git a/arch/tile/include/asm/spinlock_32.h b/arch/tile/include/asm/spinlock_32.h index a8f2c6e31a87..a5e4208d34f9 100644 --- a/arch/tile/include/asm/spinlock_32.h +++ b/arch/tile/include/asm/spinlock_32.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #ifndef _ASM_TILE_SPINLOCK_32_H | 17 | #ifndef _ASM_TILE_SPINLOCK_32_H |
18 | #define _ASM_TILE_SPINLOCK_32_H | 18 | #define _ASM_TILE_SPINLOCK_32_H |
19 | 19 | ||
20 | #include <asm/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <asm/page.h> | 21 | #include <asm/page.h> |
22 | #include <asm/system.h> | 22 | #include <asm/system.h> |
23 | #include <linux/compiler.h> | 23 | #include <linux/compiler.h> |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 72ade79b621b..fc94607f0bd5 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
22 | #include <asm/thread_info.h> | 22 | #include <asm/thread_info.h> |
23 | #include <asm/irqflags.h> | 23 | #include <asm/irqflags.h> |
24 | #include <asm/atomic.h> | 24 | #include <linux/atomic.h> |
25 | #include <asm/asm-offsets.h> | 25 | #include <asm/asm-offsets.h> |
26 | #include <hv/hypervisor.h> | 26 | #include <hv/hypervisor.h> |
27 | #include <arch/abi.h> | 27 | #include <arch/abi.h> |
diff --git a/arch/tile/lib/atomic_32.c b/arch/tile/lib/atomic_32.c index 46570211df52..771b251b409d 100644 --- a/arch/tile/lib/atomic_32.c +++ b/arch/tile/lib/atomic_32.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/uaccess.h> | 17 | #include <linux/uaccess.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
20 | #include <asm/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <asm/futex.h> | 21 | #include <asm/futex.h> |
22 | #include <arch/chip.h> | 22 | #include <arch/chip.h> |
23 | 23 | ||
diff --git a/arch/tile/lib/atomic_asm_32.S b/arch/tile/lib/atomic_asm_32.S index 24448734f6f1..1f75a2a56101 100644 --- a/arch/tile/lib/atomic_asm_32.S +++ b/arch/tile/lib/atomic_asm_32.S | |||
@@ -70,7 +70,7 @@ | |||
70 | */ | 70 | */ |
71 | 71 | ||
72 | #include <linux/linkage.h> | 72 | #include <linux/linkage.h> |
73 | #include <asm/atomic.h> | 73 | #include <linux/atomic.h> |
74 | #include <asm/page.h> | 74 | #include <asm/page.h> |
75 | #include <asm/processor.h> | 75 | #include <asm/processor.h> |
76 | 76 | ||