tools/power/x86/intel-speed-select: Fix cpu-count output
authorPrarit Bhargava <prarit@redhat.com>
Thu, 5 Sep 2019 12:03:05 +0000 (08:03 -0400)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 7 Sep 2019 18:19:13 +0000 (21:19 +0300)
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: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
tools/power/x86/intel-speed-select/isst-config.c

index d32af8210427bdfecf6711b77e4dff56c0042417..f81a28c6b5865413cd4d25e9fc6be357221e0487 100644 (file)
@@ -304,7 +304,7 @@ static void set_cpu_present_cpu_mask(void)
 int get_cpu_count(int pkg_id, int die_id)
 {
        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;
 }