After adding a 'struct task_struct' predeclaration the <linux/sched/wake_q.h>
file becomes a self-contained header and users of it either don't need
<linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Mike Galbraith <efa...@gmx.de>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 include/linux/sched/wake_q.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h
index ed66823e845b..e6774a0385fb 100644
--- a/include/linux/sched/wake_q.h
+++ b/include/linux/sched/wake_q.h
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_WAKE_Q_H
 #define _LINUX_SCHED_WAKE_Q_H
 
-#include <linux/sched.h>
-
 /*
  * Wake-queues are lists of tasks with a pending wakeup, whose
  * callers have already marked the task as woken internally,
@@ -29,6 +27,9 @@
  * must ensure the call is done inside a loop, confirming that the
  * wakeup condition has in fact occurred.
  */
+
+struct task_struct;
+
 struct wake_q_node {
        struct wake_q_node *next;
 };
-- 
2.7.4

Reply via email to