diff options
author | Arun Sharma <asharma@fb.com> | 2011-07-26 19:09:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:47 -0400 |
commit | 7847777a45f9f8bfc8617dbf107bde1ecb59caee (patch) | |
tree | f9e31828db79e607a763f1eaea2119b2f270dcdb /arch | |
parent | f24219b4e90cf70ec4a211b17fbabc725a0ddf3c (diff) |
atomic: cleanup asm-generic atomic*.h inclusion
After changing all consumers of atomics to include <linux/atomic.h>, we
ran into some compile time errors due to this dependency chain:
linux/atomic.h
-> asm/atomic.h
-> asm-generic/atomic-long.h
where atomic-long.h could use funcs defined later in linux/atomic.h
without a prototype. This patches moves the code that includes
asm-generic/atomic*.h to linux/atomic.h.
Archs that need <asm-generic/atomic64.h> need to select
CONFIG_GENERIC_ATOMIC64 from now on (some of them used to include it
unconditionally).
Compile tested on i386 and x86_64 with allnoconfig.
Signed-off-by: Arun Sharma <asharma@fb.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
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')
-rw-r--r-- | arch/alpha/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/atomic.h | 5 | ||||
-rw-r--r-- | arch/avr32/include/asm/atomic.h | 2 | ||||
-rw-r--r-- | arch/blackfin/include/asm/atomic.h | 3 | ||||
-rw-r--r-- | arch/cris/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/frv/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/ia64/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/m32r/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/m68k/include/asm/atomic.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/atomic.h | 6 | ||||
-rw-r--r-- | arch/mn10300/include/asm/atomic.h | 2 | ||||
-rw-r--r-- | arch/parisc/include/asm/atomic.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/atomic.h | 4 | ||||
-rw-r--r-- | arch/s390/include/asm/atomic.h | 2 | ||||
-rw-r--r-- | arch/sh/include/asm/atomic.h | 3 | ||||
-rw-r--r-- | arch/sparc/include/asm/atomic_32.h | 1 | ||||
-rw-r--r-- | arch/sparc/include/asm/atomic_64.h | 1 | ||||
-rw-r--r-- | arch/tile/include/asm/atomic.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | arch/xtensa/include/asm/atomic.h | 1 |
21 files changed, 1 insertions, 48 deletions
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h index 3d6704910268..640f909ddd41 100644 --- a/arch/alpha/include/asm/atomic.h +++ b/arch/alpha/include/asm/atomic.h | |||
@@ -255,5 +255,4 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
255 | #define smp_mb__before_atomic_inc() smp_mb() | 255 | #define smp_mb__before_atomic_inc() smp_mb() |
256 | #define smp_mb__after_atomic_inc() smp_mb() | 256 | #define smp_mb__after_atomic_inc() smp_mb() |
257 | 257 | ||
258 | #include <asm-generic/atomic-long.h> | ||
259 | #endif /* _ALPHA_ATOMIC_H */ | 258 | #endif /* _ALPHA_ATOMIC_H */ |
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index 3757e91c5281..86976d034382 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h | |||
@@ -459,9 +459,6 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u) | |||
459 | #define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0) | 459 | #define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0) |
460 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL) | 460 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL) |
461 | 461 | ||
462 | #else /* !CONFIG_GENERIC_ATOMIC64 */ | 462 | #endif /* !CONFIG_GENERIC_ATOMIC64 */ |
463 | #include <asm-generic/atomic64.h> | ||
464 | #endif | ||
465 | #include <asm-generic/atomic-long.h> | ||
466 | #endif | 463 | #endif |
467 | #endif | 464 | #endif |
diff --git a/arch/avr32/include/asm/atomic.h b/arch/avr32/include/asm/atomic.h index dc6c3a41a2d7..e0ac2631c87e 100644 --- a/arch/avr32/include/asm/atomic.h +++ b/arch/avr32/include/asm/atomic.h | |||
@@ -188,6 +188,4 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v) | |||
188 | #define smp_mb__before_atomic_inc() barrier() | 188 | #define smp_mb__before_atomic_inc() barrier() |
189 | #define smp_mb__after_atomic_inc() barrier() | 189 | #define smp_mb__after_atomic_inc() barrier() |
190 | 190 | ||
191 | #include <asm-generic/atomic-long.h> | ||
192 | |||
193 | #endif /* __ASM_AVR32_ATOMIC_H */ | 191 | #endif /* __ASM_AVR32_ATOMIC_H */ |
diff --git a/arch/blackfin/include/asm/atomic.h b/arch/blackfin/include/asm/atomic.h index 292c86f74f85..135225696fd2 100644 --- a/arch/blackfin/include/asm/atomic.h +++ b/arch/blackfin/include/asm/atomic.h | |||
@@ -111,10 +111,7 @@ static inline void atomic_set_mask(int mask, atomic_t *v) | |||
111 | #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) | 111 | #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) |
112 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) | 112 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) |
113 | 113 | ||
114 | #include <asm-generic/atomic-long.h> | ||
115 | 114 | ||
116 | #endif | 115 | #endif |
117 | 116 | ||
118 | #include <asm-generic/atomic64.h> | ||
119 | |||
120 | #endif | 117 | #endif |
diff --git a/arch/cris/include/asm/atomic.h b/arch/cris/include/asm/atomic.h index 7e90532c5253..bbf093814db2 100644 --- a/arch/cris/include/asm/atomic.h +++ b/arch/cris/include/asm/atomic.h | |||
@@ -157,5 +157,4 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) | |||
157 | #define smp_mb__before_atomic_inc() barrier() | 157 | #define smp_mb__before_atomic_inc() barrier() |
158 | #define smp_mb__after_atomic_inc() barrier() | 158 | #define smp_mb__after_atomic_inc() barrier() |
159 | 159 | ||
160 | #include <asm-generic/atomic-long.h> | ||
161 | #endif | 160 | #endif |
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h index a51dcdfe1fbf..0d8a7d661740 100644 --- a/arch/frv/include/asm/atomic.h +++ b/arch/frv/include/asm/atomic.h | |||
@@ -257,5 +257,4 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) | |||
257 | } | 257 | } |
258 | 258 | ||
259 | 259 | ||
260 | #include <asm-generic/atomic-long.h> | ||
261 | #endif /* _ASM_ATOMIC_H */ | 260 | #endif /* _ASM_ATOMIC_H */ |
diff --git a/arch/h8300/include/asm/atomic.h b/arch/h8300/include/asm/atomic.h index e6d1663625f0..f5a38c1f5489 100644 --- a/arch/h8300/include/asm/atomic.h +++ b/arch/h8300/include/asm/atomic.h | |||
@@ -145,5 +145,4 @@ static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v) | |||
145 | #define smp_mb__before_atomic_inc() barrier() | 145 | #define smp_mb__before_atomic_inc() barrier() |
146 | #define smp_mb__after_atomic_inc() barrier() | 146 | #define smp_mb__after_atomic_inc() barrier() |
147 | 147 | ||
148 | #include <asm-generic/atomic-long.h> | ||
149 | #endif /* __ARCH_H8300_ATOMIC __ */ | 148 | #endif /* __ARCH_H8300_ATOMIC __ */ |
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h index 22aca210bd05..3fad89ee01cb 100644 --- a/arch/ia64/include/asm/atomic.h +++ b/arch/ia64/include/asm/atomic.h | |||
@@ -215,5 +215,4 @@ atomic64_add_negative (__s64 i, atomic64_t *v) | |||
215 | #define smp_mb__before_atomic_inc() barrier() | 215 | #define smp_mb__before_atomic_inc() barrier() |
216 | #define smp_mb__after_atomic_inc() barrier() | 216 | #define smp_mb__after_atomic_inc() barrier() |
217 | 217 | ||
218 | #include <asm-generic/atomic-long.h> | ||
219 | #endif /* _ASM_IA64_ATOMIC_H */ | 218 | #endif /* _ASM_IA64_ATOMIC_H */ |
diff --git a/arch/m32r/include/asm/atomic.h b/arch/m32r/include/asm/atomic.h index c839426ac732..1e7f29fb21f2 100644 --- a/arch/m32r/include/asm/atomic.h +++ b/arch/m32r/include/asm/atomic.h | |||
@@ -313,5 +313,4 @@ static __inline__ void atomic_set_mask(unsigned long mask, atomic_t *addr) | |||
313 | #define smp_mb__before_atomic_inc() barrier() | 313 | #define smp_mb__before_atomic_inc() barrier() |
314 | #define smp_mb__after_atomic_inc() barrier() | 314 | #define smp_mb__after_atomic_inc() barrier() |
315 | 315 | ||
316 | #include <asm-generic/atomic-long.h> | ||
317 | #endif /* _ASM_M32R_ATOMIC_H */ | 316 | #endif /* _ASM_M32R_ATOMIC_H */ |
diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 2269350974f1..65c6be6c8180 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h | |||
@@ -205,6 +205,4 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) | |||
205 | #define smp_mb__before_atomic_inc() barrier() | 205 | #define smp_mb__before_atomic_inc() barrier() |
206 | #define smp_mb__after_atomic_inc() barrier() | 206 | #define smp_mb__after_atomic_inc() barrier() |
207 | 207 | ||
208 | #include <asm-generic/atomic-long.h> | ||
209 | #include <asm-generic/atomic64.h> | ||
210 | #endif /* __ARCH_M68K_ATOMIC __ */ | 208 | #endif /* __ARCH_M68K_ATOMIC __ */ |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 31cb23debb7e..1d93f81d57e7 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -765,10 +765,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
765 | */ | 765 | */ |
766 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) | 766 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) |
767 | 767 | ||
768 | #else /* !CONFIG_64BIT */ | ||
769 | |||
770 | #include <asm-generic/atomic64.h> | ||
771 | |||
772 | #endif /* CONFIG_64BIT */ | 768 | #endif /* CONFIG_64BIT */ |
773 | 769 | ||
774 | /* | 770 | /* |
@@ -780,6 +776,4 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
780 | #define smp_mb__before_atomic_inc() smp_mb__before_llsc() | 776 | #define smp_mb__before_atomic_inc() smp_mb__before_llsc() |
781 | #define smp_mb__after_atomic_inc() smp_llsc_mb() | 777 | #define smp_mb__after_atomic_inc() smp_llsc_mb() |
782 | 778 | ||
783 | #include <asm-generic/atomic-long.h> | ||
784 | |||
785 | #endif /* _ASM_ATOMIC_H */ | 779 | #endif /* _ASM_ATOMIC_H */ |
diff --git a/arch/mn10300/include/asm/atomic.h b/arch/mn10300/include/asm/atomic.h index a2e6759af4db..b9a8f8461262 100644 --- a/arch/mn10300/include/asm/atomic.h +++ b/arch/mn10300/include/asm/atomic.h | |||
@@ -343,8 +343,6 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *addr) | |||
343 | #define smp_mb__before_atomic_inc() barrier() | 343 | #define smp_mb__before_atomic_inc() barrier() |
344 | #define smp_mb__after_atomic_inc() barrier() | 344 | #define smp_mb__after_atomic_inc() barrier() |
345 | 345 | ||
346 | #include <asm-generic/atomic-long.h> | ||
347 | |||
348 | #endif /* __KERNEL__ */ | 346 | #endif /* __KERNEL__ */ |
349 | #endif /* CONFIG_SMP */ | 347 | #endif /* CONFIG_SMP */ |
350 | #endif /* _ASM_ATOMIC_H */ | 348 | #endif /* _ASM_ATOMIC_H */ |
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 1914f179879d..b1dc71f5534e 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -335,12 +335,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
335 | 335 | ||
336 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | 336 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) |
337 | 337 | ||
338 | #else /* CONFIG_64BIT */ | ||
339 | |||
340 | #include <asm-generic/atomic64.h> | ||
341 | |||
342 | #endif /* !CONFIG_64BIT */ | 338 | #endif /* !CONFIG_64BIT */ |
343 | 339 | ||
344 | #include <asm-generic/atomic-long.h> | ||
345 | 340 | ||
346 | #endif /* _ASM_PARISC_ATOMIC_H_ */ | 341 | #endif /* _ASM_PARISC_ATOMIC_H_ */ |
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h index 952e161fbb89..e2a4c26ad377 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h | |||
@@ -469,11 +469,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
469 | 469 | ||
470 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | 470 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) |
471 | 471 | ||
472 | #else /* __powerpc64__ */ | ||
473 | #include <asm-generic/atomic64.h> | ||
474 | |||
475 | #endif /* __powerpc64__ */ | 472 | #endif /* __powerpc64__ */ |
476 | 473 | ||
477 | #include <asm-generic/atomic-long.h> | ||
478 | #endif /* __KERNEL__ */ | 474 | #endif /* __KERNEL__ */ |
479 | #endif /* _ASM_POWERPC_ATOMIC_H_ */ | 475 | #endif /* _ASM_POWERPC_ATOMIC_H_ */ |
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h index 7b0b0a7193e5..8517d2ae3b5c 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h | |||
@@ -331,6 +331,4 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v) | |||
331 | #define smp_mb__before_atomic_inc() smp_mb() | 331 | #define smp_mb__before_atomic_inc() smp_mb() |
332 | #define smp_mb__after_atomic_inc() smp_mb() | 332 | #define smp_mb__after_atomic_inc() smp_mb() |
333 | 333 | ||
334 | #include <asm-generic/atomic-long.h> | ||
335 | |||
336 | #endif /* __ARCH_S390_ATOMIC__ */ | 334 | #endif /* __ARCH_S390_ATOMIC__ */ |
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h index 2177596d4b38..63a27dbc952e 100644 --- a/arch/sh/include/asm/atomic.h +++ b/arch/sh/include/asm/atomic.h | |||
@@ -67,7 +67,4 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) | |||
67 | #define smp_mb__before_atomic_inc() smp_mb() | 67 | #define smp_mb__before_atomic_inc() smp_mb() |
68 | #define smp_mb__after_atomic_inc() smp_mb() | 68 | #define smp_mb__after_atomic_inc() smp_mb() |
69 | 69 | ||
70 | #include <asm-generic/atomic-long.h> | ||
71 | #include <asm-generic/atomic64.h> | ||
72 | |||
73 | #endif /* __ASM_SH_ATOMIC_H */ | 70 | #endif /* __ASM_SH_ATOMIC_H */ |
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h index bdce95e77f85..5c3c8b69884d 100644 --- a/arch/sparc/include/asm/atomic_32.h +++ b/arch/sparc/include/asm/atomic_32.h | |||
@@ -160,5 +160,4 @@ static inline int __atomic24_sub(int i, atomic24_t *v) | |||
160 | 160 | ||
161 | #endif /* !(__KERNEL__) */ | 161 | #endif /* !(__KERNEL__) */ |
162 | 162 | ||
163 | #include <asm-generic/atomic-long.h> | ||
164 | #endif /* !(__ARCH_SPARC_ATOMIC__) */ | 163 | #endif /* !(__ARCH_SPARC_ATOMIC__) */ |
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index 1fc3d0a62d66..9f421df46aec 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h | |||
@@ -113,5 +113,4 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u) | |||
113 | #define smp_mb__before_atomic_inc() barrier() | 113 | #define smp_mb__before_atomic_inc() barrier() |
114 | #define smp_mb__after_atomic_inc() barrier() | 114 | #define smp_mb__after_atomic_inc() barrier() |
115 | 115 | ||
116 | #include <asm-generic/atomic-long.h> | ||
117 | #endif /* !(__ARCH_SPARC64_ATOMIC__) */ | 116 | #endif /* !(__ARCH_SPARC64_ATOMIC__) */ |
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index e3272715c3cb..921dbeb8a70c 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h | |||
@@ -177,9 +177,4 @@ extern unsigned long __cmpxchg_called_with_bad_pointer(void); | |||
177 | #include <asm/atomic_64.h> | 177 | #include <asm/atomic_64.h> |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | /* Provide the appropriate atomic_long_t definitions. */ | ||
181 | #ifndef __ASSEMBLY__ | ||
182 | #include <asm-generic/atomic-long.h> | ||
183 | #endif | ||
184 | |||
185 | #endif /* _ASM_TILE_ATOMIC_H */ | 180 | #endif /* _ASM_TILE_ATOMIC_H */ |
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 5fe9cb335cd2..10572e309ab2 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
@@ -318,5 +318,4 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) | |||
318 | # include "atomic64_64.h" | 318 | # include "atomic64_64.h" |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | #include <asm-generic/atomic-long.h> | ||
322 | #endif /* _ASM_X86_ATOMIC_H */ | 321 | #endif /* _ASM_X86_ATOMIC_H */ |
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h index e464212f9ee6..23592eff67ad 100644 --- a/arch/xtensa/include/asm/atomic.h +++ b/arch/xtensa/include/asm/atomic.h | |||
@@ -291,7 +291,6 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | |||
291 | #define smp_mb__before_atomic_inc() barrier() | 291 | #define smp_mb__before_atomic_inc() barrier() |
292 | #define smp_mb__after_atomic_inc() barrier() | 292 | #define smp_mb__after_atomic_inc() barrier() |
293 | 293 | ||
294 | #include <asm-generic/atomic-long.h> | ||
295 | #endif /* __KERNEL__ */ | 294 | #endif /* __KERNEL__ */ |
296 | 295 | ||
297 | #endif /* _XTENSA_ATOMIC_H */ | 296 | #endif /* _XTENSA_ATOMIC_H */ |