From: Arnd Bergmann Date: Thu, 28 Oct 2010 14:12:33 +0000 (+0200) Subject: preempt: fix kernel build with !CONFIG_BKL X-Git-Url: https://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=commitdiff_plain;h=7fe19da4ca38fc20cdbc7020fcf2eca8fc756410 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 Reported-and-tested-by: Kirill A. Shutemov Signed-off-by: Linus Torvalds --- diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 8a389b608ce..41cb31f14ee 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -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