summaryrefslogtreecommitdiff
path: root/include/linux/sched/deadline.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched/deadline.h')
-rw-r--r--include/linux/sched/deadline.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h
index 975be862e083..8f191a17dd02 100644
--- a/include/linux/sched/deadline.h
+++ b/include/linux/sched/deadline.h
@@ -13,7 +13,7 @@
static inline int dl_prio(int prio)
{
- if (unlikely(prio < MAX_DL_PRIO))
+ if (IS_ENABLED(CONFIG_SCHED_DL) && unlikely(prio < MAX_DL_PRIO))
return 1;
return 0;
}
@@ -28,4 +28,10 @@ static inline bool dl_time_before(u64 a, u64 b)
return (s64)(a - b) < 0;
}
+#ifdef CONFIG_SCHED_DL
+#define dl_deadline(tsk) (tsk)->dl.deadline
+#else
+#define dl_deadline(tsk) 0
+#endif
+
#endif /* _LINUX_SCHED_DEADLINE_H */