Skip to content
Snippets Groups Projects
Commit 7fe19da4 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Reported-and-tested-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 020e773f
No related branches found
No related tags found
No related merge requests found
......@@ -96,11 +96,15 @@
*/
#define in_nmi() (preempt_count() & NMI_MASK)
#if defined(CONFIG_PREEMPT)
#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
# define PREEMPT_INATOMIC_BASE kernel_locked()
# define PREEMPT_CHECK_OFFSET 1
#else
# define PREEMPT_INATOMIC_BASE 0
#endif
#if defined(CONFIG_PREEMPT)
# define PREEMPT_CHECK_OFFSET 1
#else
# define PREEMPT_CHECK_OFFSET 0
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment