diff options
author | Palmer Cox <p@lmercox.com> | 2012-11-27 13:17:47 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-27 23:07:19 +0100 |
commit | ea1021ffa65a81da3d393fcbd7509d6e40d4d325 (patch) | |
tree | 65af69a0511ce4cc8d1f3a75c3a45cd4f6d823ff /tools/power/cpupower/utils/helpers/helpers.h | |
parent | 35a169737cdf9155e890d60eae2b8fffc16d16ba (diff) | |
download | lwn-ea1021ffa65a81da3d393fcbd7509d6e40d4d325.tar.gz lwn-ea1021ffa65a81da3d393fcbd7509d6e40d4d325.zip |
cpupower tools: Fix warning and a bug with the cpu package count
The pkgs member of cpupower_topology is being used as the number of
cpu packages. As the comment in get_cpu_topology notes, the package ids
are not guaranteed to be contiguous. So, simply setting pkgs to the value
of the highest physical_package_id doesn't actually provide a count of
the number of cpu packages. Instead, calculate pkgs by setting it to
the number of distinct physical_packge_id values which is pretty easy
to do after the core_info structs are sorted. Calculating pkgs this
way also has the nice benefit of getting rid of a sign comparison warning
that GCC 4.6 was reporting.
Signed-off-by: Palmer Cox <p@lmercox.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/cpupower/utils/helpers/helpers.h')
0 files changed, 0 insertions, 0 deletions