
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8T2RT -------------------------------- lockdep_is_cpus_held() will only be compiled by the kernel when CONFIG_LOCKDEP is defined. Otherwise, kernel test robot would report the following compile error: ld: vmlinux.o: in function `resctrl_get_domain_from_cpu': include/linux/resctrl.h:291: undefined reference to `lockdep_is_cpus_held' Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202401252038.VOiTn1TA-lkp@intel.com/ Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- include/linux/resctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index dd34523469a5..f4aeccd78afb 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -300,7 +300,7 @@ resctrl_get_domain_from_cpu(int cpu, struct rdt_resource *r) * about locks this thread holds will lead to false positives. Check * someone is holding the CPUs lock. */ - if (IS_ENABLED(CONFIG_LOCKDEP)) + if (IS_ENABLED(CONFIG_HOTPLUG_CPU) && IS_ENABLED(CONFIG_LOCKDEP)) lockdep_is_cpus_held(); list_for_each_entry_rcu(d, &r->domains, list) { -- 2.25.1