Commit 8dd36c42 authored by Liu Shixin's avatar Liu Shixin Committed by Zheng Zengkai
Browse files

dynamic_hugetlb: fix undefined struct cftype

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I576NI


CVE: NA
backport: openEuler-22.03-LTS

--------------------------------

There is a build warning when !CONFIG_CGROUPS:

In file included from ./include/linux/memcontrol.h:25,
                 from ./include/linux/swap.h:10,
                 from ./include/linux/suspend.h:5,
                 from drivers/cpuidle/cpuidle.c:23:
./include/linux/dynamic_hugetlb.h:115:47: warning: ‘struct cftype’ declared
inside parameter list will not be visible outside of this definition or
declaration
  115 | static inline bool dhugetlb_hide_files(struct cftype *cft)
      |                                               ^~~~~~

Since the function is only invoked when CONFIG_CGROUPS enabled, we can fix it
by restricting its definition to on CONFIG_CGROUPS.

Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4ad3e08b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment