This patch alters the Comedi driver's linux/sched.h compatibility header
to move the need_resched function after the #include_next directive.
This is because the 'current' task variable is not defined until after
the real linux/sched.h is included. I've also removed the comment - "/*
not sure exactly when need_resched() was added */"; I've checked, and it
was added in 2.4.20 as the code stated. I thought I'd fix the incorrect
comment at the top of the file while I was at it.
/*
- * linux/fs.h compatibility header
+ * linux/sched.h compatibility header
*/
#ifndef __COMPAT_LINUX_SCHED_H_
#define signal_pending(x) (((x)->signal) & (~(x)->blocked))
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20) /* not sure exactly when need_resched() was added */
+#include_next <linux/sched.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
static inline int need_resched(void)
{
return current->need_resched;
}
#endif
-#include_next <linux/sched.h>
-
#endif