Commit 65348ba2 authored by Yunfeng Ye's avatar Yunfeng Ye Committed by Rafael J. Wysocki

powercap: intel_rapl: Use topology interface in rapl_init_domains()

It's not a good idea to access the phys_proc_id of cpuinfo directly.

Use topology_physical_package_id(cpu) instead.
Signed-off-by: default avatarYunfeng Ye <yeyunfeng@huawei.com>
[ rjw: Changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 88ffce95
...@@ -547,7 +547,7 @@ static void rapl_init_domains(struct rapl_package *rp) ...@@ -547,7 +547,7 @@ static void rapl_init_domains(struct rapl_package *rp)
if (i == RAPL_DOMAIN_PLATFORM && rp->id > 0) { if (i == RAPL_DOMAIN_PLATFORM && rp->id > 0) {
snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "psys-%d", snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "psys-%d",
cpu_data(rp->lead_cpu).phys_proc_id); topology_physical_package_id(rp->lead_cpu));
} else } else
snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "%s", snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "%s",
rapl_domain_names[i]); rapl_domain_names[i]);
......
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