lockref: use BLOATED_SPINLOCKS to avoid explicit config dependencies
[firefly-linux-kernel-4.4.55.git] / include / linux / lockref.h
index 13dfd36a329474df228102dd49bafbdf1b5c687d..c8929c3832db26d00d80f96e524afbb0e75c4df1 100644 (file)
  */
 
 #include <linux/spinlock.h>
+#include <generated/bounds.h>
+
+#define USE_CMPXCHG_LOCKREF \
+       (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \
+        IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS)
 
 struct lockref {
        union {
-#ifdef CONFIG_CMPXCHG_LOCKREF
+#if USE_CMPXCHG_LOCKREF
                aligned_u64 lock_count;
 #endif
                struct {