Skip to content

Commit d90a2f1

Browse files
committed
sched/headers: Add header guard to kernel/sched/stats.h and kernel/sched/autogroup.h
Protect against multiple inclusion. Also include "sched.h" in "stat.h", as it relies on it. Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Peter Zijlstra <peterz@infradead.org>
1 parent 9545847 commit d90a2f1

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

kernel/sched/autogroup.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _KERNEL_SCHED_AUTOGROUP_H
3+
#define _KERNEL_SCHED_AUTOGROUP_H
4+
25
#ifdef CONFIG_SCHED_AUTOGROUP
36

47
struct autogroup {
@@ -59,3 +62,5 @@ static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
5962
}
6063

6164
#endif /* CONFIG_SCHED_AUTOGROUP */
65+
66+
#endif /* _KERNEL_SCHED_AUTOGROUP_H */

kernel/sched/stats.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _KERNEL_STATS_H
3+
#define _KERNEL_STATS_H
24

35
#ifdef CONFIG_SCHEDSTATS
46

7+
#include "sched.h"
8+
59
extern struct static_key_false sched_schedstats;
610

711
/*
@@ -298,3 +302,5 @@ sched_info_switch(struct rq *rq, struct task_struct *prev, struct task_struct *n
298302
# define sched_info_dequeue(rq, t) do { } while (0)
299303
# define sched_info_switch(rq, t, next) do { } while (0)
300304
#endif /* CONFIG_SCHED_INFO */
305+
306+
#endif /* _KERNEL_STATS_H */

0 commit comments

Comments
 (0)