preempt: fix kernel build with !CONFIG_BKL

The preempt count logic tries to take the BKL into account, which breaks
when CONFIG_BKL is not set.

Use the same preempt_count offset that we use without CONFIG_PREEMPT
when CONFIG_BKL is disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-and-tested-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arnd Bergmann and committed by
Linus Torvalds
7fe19da4 020e773f

+6 -2
+6 -2
include/linux/hardirq.h
··· 96 96 */ 97 97 #define in_nmi() (preempt_count() & NMI_MASK) 98 98 99 - #if defined(CONFIG_PREEMPT) 99 + #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) 100 100 # define PREEMPT_INATOMIC_BASE kernel_locked() 101 - # define PREEMPT_CHECK_OFFSET 1 102 101 #else 103 102 # define PREEMPT_INATOMIC_BASE 0 103 + #endif 104 + 105 + #if defined(CONFIG_PREEMPT) 106 + # define PREEMPT_CHECK_OFFSET 1 107 + #else 104 108 # define PREEMPT_CHECK_OFFSET 0 105 109 #endif 106 110