[linux-yocto] [PATCH] softirq: Remove duplication of defining in_serving_softirq macro

Daniel Dragomir daniel.dragomir at windriver.com
Fri Dec 8 10:05:56 PST 2017


After commit 7469ff09b8e2 ("softirq: Split softirq locks"), this
macro is defined only if CONFIG_PREEMPT_RT_FULL kernel option
is not set.

+#ifndef CONFIG_PREEMPT_RT_FULL
+# define softirq_count()       (preempt_count() & SOFTIRQ_MASK)
+# define in_serving_softirq()  (softirq_count() & SOFTIRQ_OFFSET)
+#else
+# define softirq_count()       (0UL)
+extern int in_serving_softirq(void);
+#endif

-#define in_serving_softirq()   (softirq_count() & SOFTIRQ_OFFSET)

But after commit 2715f6841a08 ("x86/uaccess, sched/preempt: Verify
access_ok() context"), this define line is present and it duplicates
the one from ifndef statement.

This will bring to the following error when compiling PREEMPT-RT
kernel:

| kernel/softirq.c:615:28: error: macro "in_serving_softirq" passed
| 1 arguments, but takes just 0
| kernel/softirq.c:616:1: error: expected '=', ',', ';', 'asm' or
| '__attribute__' before '{' token
| scripts/Makefile.build:293: recipe for target 'kernel/softirq.o'
| failed

Maybe it's a merge issue.

Signed-off-by: Daniel Dragomir <daniel.dragomir at windriver.com>
---
 include/linux/preempt.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index ca0d03f..f97c542 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -89,7 +89,6 @@ extern int in_serving_softirq(void);
 #define in_irq()		(hardirq_count())
 #define in_softirq()		(softirq_count())
 #define in_interrupt()		(irq_count())
-#define in_serving_softirq()	(softirq_count() & SOFTIRQ_OFFSET)
 #define in_nmi()		(preempt_count() & NMI_MASK)
 #define in_task()		(!(preempt_count() & \
 				   (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
-- 
2.7.4



More information about the linux-yocto mailing list