Skip to content

Commit 459e395

Browse files
herbertxPeter Zijlstra
authored andcommitted
locking/qspinlock: Do not include atomic.h from qspinlock_types.h
This patch breaks a header loop involving qspinlock_types.h. The issue is that qspinlock_types.h includes atomic.h, which then eventually includes kernel.h which could lead back to the original file via spinlock_types.h. As ATOMIC_INIT is now defined by linux/types.h, there is no longer any need to include atomic.h from qspinlock_types.h. This also allows the CONFIG_PARAVIRT hack to be removed since it was trying to prevent exactly this loop. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Waiman Long <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 7ca8cf5 commit 459e395

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

include/asm-generic/qspinlock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define __ASM_GENERIC_QSPINLOCK_H
1212

1313
#include <asm-generic/qspinlock_types.h>
14+
#include <linux/atomic.h>
1415

1516
/**
1617
* queued_spin_is_locked - is the spinlock locked?

include/asm-generic/qspinlock_types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99
#ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H
1010
#define __ASM_GENERIC_QSPINLOCK_TYPES_H
1111

12-
/*
13-
* Including atomic.h with PARAVIRT on will cause compilation errors because
14-
* of recursive header file incluson via paravirt_types.h. So don't include
15-
* it if PARAVIRT is on.
16-
*/
17-
#ifndef CONFIG_PARAVIRT
1812
#include <linux/types.h>
19-
#include <linux/atomic.h>
20-
#endif
2113

2214
typedef struct qspinlock {
2315
union {

0 commit comments

Comments
 (0)