summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunfeng Ye <yeyunfeng@huawei.com>2021-01-23 05:06:08 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-02-12 16:53:01 +0100
commit65348ba259e27ad4b69459ef477facd4c702bbf6 (patch)
tree0d8234174137f0248fdc95cde46a0d0400c4d260
parent88ffce95764603e13eda4be003ec919e124ec365 (diff)
downloadlwn-65348ba259e27ad4b69459ef477facd4c702bbf6.tar.gz
lwn-65348ba259e27ad4b69459ef477facd4c702bbf6.zip
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: Yunfeng Ye <yeyunfeng@huawei.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/powercap/intel_rapl_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index b6c7bedf517e..fdda2a737186 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -547,7 +547,7 @@ static void rapl_init_domains(struct rapl_package *rp)
if (i == RAPL_DOMAIN_PLATFORM && rp->id > 0) {
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
snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "%s",
rapl_domain_names[i]);