linux/preempt.h needs linux/thread_info.h
PATCH 1/1 linux/preempt.h needs linux/thread_info.h
It seems that linux/preempt.h needs to include linux/thread_info.h in order to access current_thread_info(), which is used in preempt_count().
I guess that all callers of preempt_count() must include both linux/thread_info.h and linux/preempt.h directly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.
include/linux/preempt.h +1 -0
@@ -8,6 +8,7 @@#include <linux/thread_info.h> #include <linux/linkage.h> +#include <linux/thread_info.h> #ifdef CONFIG_DEBUG_PREEMPT extern void fastcall add_preempt_count(int val);
Quoted 16 lines · Horms
It seems that
linux/preempt.hneeds to includelinux/thread_info.hin order to accesscurrent_thread_info(), which is used inpreempt_count().I guess that all callers of
preempt_count()must include bothlinux/thread_info.handlinux/preempt.hdirectly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.Signed-off-by Simon Horman <[email protected]>Index:
linux-2.6/include/linux/preempt.h
===================================================================
include/linux/preempt.h line 11
Quoted 4 lines
include/linux/preempt.h +1
-0@@ -8,6 +8,7 @@#include <linux/thread_info.h> #include <linux/linkage.h> +#include <linux/thread_info.h>
Huh? It's just been included two lines above...
Quoted 18 lines · Al Viro
Quoted 17 lines · Horms
It seems that
linux/preempt.hneeds to includelinux/thread_info.hin order to accesscurrent_thread_info(), which is used inpreempt_count().I guess that all callers of
preempt_count()must include bothlinux/thread_info.handlinux/preempt.hdirectly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.Signed-off-by Simon Horman <[email protected]>Index:
linux-2.6/include/linux/preempt.h
===================================================================include/linux/preempt.h +0
-0@@ -8,6 +8,7 @@
Quoted 5 lines
include/linux/preempt.h line 11
Quoted 3 lines
include/linux/preempt.h +1
-0#include <linux/thread_info.h> #include <linux/linkage.h> +#include <linux/thread_info.h> Huh? It's just been included two lines above...
Sorry about that. I mucked around with this for a while and ended up missing the obvious when doing the forward-port.
Signature · 3 lines
Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/