Skip to content

Commit 51e50fb

Browse files
surenbaghdasaryantorvalds
authored andcommitted
psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
When CONFIG_CGROUPS is disabled psi code generates the following warnings: kernel/sched/psi.c:1112:21: warning: no previous prototype for 'psi_trigger_create' [-Wmissing-prototypes] 1112 | struct psi_trigger *psi_trigger_create(struct psi_group *group, | ^~~~~~~~~~~~~~~~~~ kernel/sched/psi.c:1182:6: warning: no previous prototype for 'psi_trigger_destroy' [-Wmissing-prototypes] 1182 | void psi_trigger_destroy(struct psi_trigger *t) | ^~~~~~~~~~~~~~~~~~~ kernel/sched/psi.c:1249:10: warning: no previous prototype for 'psi_trigger_poll' [-Wmissing-prototypes] 1249 | __poll_t psi_trigger_poll(void **trigger_ptr, | ^~~~~~~~~~~~~~~~ Change the declarations of these functions in the header to provide the prototypes even when they are unused. Link: https://lkml.kernel.org/r/[email protected] Fixes: 0e94682 ("psi: introduce psi monitor") Signed-off-by: Suren Baghdasaryan <[email protected]> Reported-by: kernel test robot <[email protected]> Acked-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 27fe733 commit 51e50fb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

include/linux/psi.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@ void psi_memstall_enter(unsigned long *flags);
2525
void psi_memstall_leave(unsigned long *flags);
2626

2727
int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res);
28-
29-
#ifdef CONFIG_CGROUPS
30-
int psi_cgroup_alloc(struct cgroup *cgrp);
31-
void psi_cgroup_free(struct cgroup *cgrp);
32-
void cgroup_move_task(struct task_struct *p, struct css_set *to);
33-
3428
struct psi_trigger *psi_trigger_create(struct psi_group *group,
3529
char *buf, size_t nbytes, enum psi_res res);
3630
void psi_trigger_destroy(struct psi_trigger *t);
3731

3832
__poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
3933
poll_table *wait);
34+
35+
#ifdef CONFIG_CGROUPS
36+
int psi_cgroup_alloc(struct cgroup *cgrp);
37+
void psi_cgroup_free(struct cgroup *cgrp);
38+
void cgroup_move_task(struct task_struct *p, struct css_set *to);
4039
#endif
4140

4241
#else /* CONFIG_PSI */

0 commit comments

Comments
 (0)