Re: [PATCH] cgroup: put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED

From: Kamalesh Babulal
Date: Tue Jul 11 2023 - 03:21:09 EST




On 7/11/23 08:08, Miaohe Lin wrote:
> Put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED to fix the warning
> of 'cgroup_tryget_css' defined but not used [-Wunused-function] when
> CONFIG_CGROUP_SCHED is disabled.
>
> Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
> ---
> kernel/cgroup/cgroup.c | 44 +++++++++++++++++++++---------------------
> 1 file changed, 22 insertions(+), 22 deletions(-)

Looks good to me, given that the only caller cgroup_extra_stat_show() is
guarded within CONFIG_CGROUP_SCHED (linux-next tree), it makes sense to,
also move cgroup_tryget_css() within the same ifdef block.

Reviewed-by: Kamalesh Babulal <kamalesh.babulal@xxxxxxxxxx>