Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dan.streetman@canonical.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <Waiman.Long@hpe.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455907767-17821-1-git-send-email-dan.streetman@canonical.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Dan Streetman and committed by
Ingo Molnar
b82e5302 1329ce6f

+5 -5
-5
include/asm-generic/qspinlock.h
··· 120 120 #endif 121 121 122 122 /* 123 - * Initializier 124 - */ 125 - #define __ARCH_SPIN_LOCK_UNLOCKED { ATOMIC_INIT(0) } 126 - 127 - /* 128 123 * Remapping spinlock architecture specific functions to the corresponding 129 124 * queued spinlock functions. 130 125 */
+5
include/asm-generic/qspinlock_types.h
··· 33 33 } arch_spinlock_t; 34 34 35 35 /* 36 + * Initializier 37 + */ 38 + #define __ARCH_SPIN_LOCK_UNLOCKED { ATOMIC_INIT(0) } 39 + 40 + /* 36 41 * Bitfields in the atomic value: 37 42 * 38 43 * When NR_CPUS < 16K