Skip to content

Commit

Permalink
powercap: intel_rapl: Use topology interface in rapl_init_domains()
Browse files Browse the repository at this point in the history
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 <[email protected]>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
yeyunfeng-dev authored and rafaeljw committed Feb 12, 2021
1 parent 88ffce9 commit 65348ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/powercap/intel_rapl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 65348ba

Please sign in to comment.