diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2023-07-06 17:42:42 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2023-07-10 10:23:41 -1000 |
commit | 1299eb2b0ad5812dd6e5ea5b631da61f9e791bb3 (patch) | |
tree | f0d105c47f2f55426208534c64ad2c713791dcc1 | |
parent | 2246ca53d7b3c286348c9c4cc4d2551972619cc2 (diff) | |
download | linux-stable-1299eb2b0ad5812dd6e5ea5b631da61f9e791bb3.tar.gz linux-stable-1299eb2b0ad5812dd6e5ea5b631da61f9e791bb3.tar.bz2 linux-stable-1299eb2b0ad5812dd6e5ea5b631da61f9e791bb3.zip |
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: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | kernel/cgroup/cgroup.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index b0d98542eea2..4137eb4a3000 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -3654,9 +3654,10 @@ static int cgroup_stat_show(struct seq_file *seq, void *v) return 0; } -static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, - struct cgroup *cgrp, int ssid) +#ifdef CONFIG_CGROUP_SCHED +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_state *css; int ret; @@ -3672,15 +3673,15 @@ static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, css_put(css); return ret; } +#endif static int cpu_stat_show(struct seq_file *seq, void *v) { - struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup; int ret = 0; cgroup_base_stat_cputime_show(seq); #ifdef CONFIG_CGROUP_SCHED - ret = cgroup_extra_stat_show(seq, cgrp, cpu_cgrp_id); + ret = cgroup_extra_stat_show(seq, cpu_cgrp_id); #endif return ret; } |