From b82e530290a0437522720becaf4abdf8ca4cb7d2 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Fri, 19 Feb 2016 13:49:27 -0500 Subject: locking/qspinlock: Move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h Move the __ARCH_SPIN_LOCK_UNLOCKED definition from qspinlock.h into qspinlock_types.h. The definition of __ARCH_SPIN_LOCK_UNLOCKED comes from the build arch's include files; but on x86 when CONFIG_QUEUED_SPINLOCKS=y, it just it's defined in asm-generic/qspinlock.h. In most cases, this doesn't matter because linux/spinlock.h includes asm/spinlock.h, which for x86 includes asm-generic/qspinlock.h. However, any code that only includes linux/mutex.h will break, because it only includes asm/spinlock_types.h. For example, this breaks systemtap, which only includes mutex.h. Signed-off-by: Dan Streetman Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Cc: Andrew Morton Cc: Arnd Bergmann Cc: Dan Streetman Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1455907767-17821-1-git-send-email-dan.streetman@canonical.com Signed-off-by: Ingo Molnar --- include/asm-generic/qspinlock_types.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/asm-generic/qspinlock_types.h') diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h index 85f888e86761..034acd0c4956 100644 --- a/include/asm-generic/qspinlock_types.h +++ b/include/asm-generic/qspinlock_types.h @@ -32,6 +32,11 @@ typedef struct qspinlock { atomic_t val; } arch_spinlock_t; +/* + * Initializier + */ +#define __ARCH_SPIN_LOCK_UNLOCKED { ATOMIC_INIT(0) } + /* * Bitfields in the atomic value: * -- cgit v1.2.3