Commit 3ec2aef1 authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Andy Shevchenko

tools/power/x86/intel-speed-select: Fix cpu-count output

I have a system with 28 threads/socket but intel-speed-select reports
a cpu-count of 29.

Fix an off-by-one error in the cpu_count() function.
Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 43774c0d
...@@ -304,7 +304,7 @@ static void set_cpu_present_cpu_mask(void) ...@@ -304,7 +304,7 @@ static void set_cpu_present_cpu_mask(void)
int get_cpu_count(int pkg_id, int die_id) int get_cpu_count(int pkg_id, int die_id)
{ {
if (pkg_id < MAX_PACKAGE_COUNT && die_id < MAX_DIE_PER_PACKAGE) if (pkg_id < MAX_PACKAGE_COUNT && die_id < MAX_DIE_PER_PACKAGE)
return cpu_cnt[pkg_id][die_id] + 1; return cpu_cnt[pkg_id][die_id];
return 0; return 0;
} }
......
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