Skip to content

Commit

Permalink
x86/headers: Don't include asm/processor.h in asm/atomic.h
Browse files Browse the repository at this point in the history
asm/atomic.h doesn't really need asm/processor.h anymore. Everything
it uses has moved to other header files. So remove that include.

processor.h is a nasty header that includes lots of
other headers and makes it prone to include loops. Removing the
include here makes asm/atomic.h a "leaf" header that can
be safely included in most other headers.

The only fallout is in the lib/atomic tester which relied on
this implicit include. Give it an explicit include.
(the include is in ifdef because the user is also in ifdef)

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Dec 6, 2015
1 parent da008ee commit 153a433
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion arch/x86/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/processor.h>
#include <asm/alternative.h>
#include <asm/cmpxchg.h>
#include <asm/rmwcc.h>
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/atomic64_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/processor.h>
//#include <asm/cmpxchg.h>

/* An 64bit atomic type */
Expand Down
4 changes: 4 additions & 0 deletions lib/atomic64_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#include <linux/kernel.h>
#include <linux/atomic.h>

#ifdef CONFIG_X86
#include <asm/processor.h> /* for boot_cpu_has below */
#endif

#define TEST(bit, op, c_op, val) \
do { \
atomic##bit##_set(&v, v0); \
Expand Down

0 comments on commit 153a433

Please sign in to comment.