Commit 1299eb2b authored by Miaohe Lin's avatar Miaohe Lin Committed by Tejun Heo

cgroup: minor cleanup for cgroup_extra_stat_show()

Make it under CONFIG_CGROUP_SCHED to rid of __maybe_unused annotation.
And further fetch cgrp inside cgroup_extra_stat_show() directly to rid
of __maybe_unused annotation of cgrp. No functional change intended.
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 2246ca53
...@@ -3654,9 +3654,10 @@ static int cgroup_stat_show(struct seq_file *seq, void *v) ...@@ -3654,9 +3654,10 @@ static int cgroup_stat_show(struct seq_file *seq, void *v)
return 0; return 0;
} }
static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, #ifdef CONFIG_CGROUP_SCHED
struct cgroup *cgrp, int ssid) static int cgroup_extra_stat_show(struct seq_file *seq, int ssid)
{ {
struct cgroup *cgrp = seq_css(seq)->cgroup;
struct cgroup_subsys *ss = cgroup_subsys[ssid]; struct cgroup_subsys *ss = cgroup_subsys[ssid];
struct cgroup_subsys_state *css; struct cgroup_subsys_state *css;
int ret; int ret;
...@@ -3672,15 +3673,15 @@ static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, ...@@ -3672,15 +3673,15 @@ static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq,
css_put(css); css_put(css);
return ret; return ret;
} }
#endif
static int cpu_stat_show(struct seq_file *seq, void *v) static int cpu_stat_show(struct seq_file *seq, void *v)
{ {
struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup;
int ret = 0; int ret = 0;
cgroup_base_stat_cputime_show(seq); cgroup_base_stat_cputime_show(seq);
#ifdef CONFIG_CGROUP_SCHED #ifdef CONFIG_CGROUP_SCHED
ret = cgroup_extra_stat_show(seq, cgrp, cpu_cgrp_id); ret = cgroup_extra_stat_show(seq, cpu_cgrp_id);
#endif #endif
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment