Files
android_kernel_xiaomi_sm8450/tools/power/cpupower/utils/helpers/misc.c
Sherry Hurwitz 6ae78b4e7c cpupower: Fix bug where return value was not used
Save return value from amd_pci_get_num_boost_states
and remove redundant setting of *support

Signed-off-by: Sherry Hurwitz <sherry.hurwitz@amd.com>
Reviewed-by: Thomas Renninger <trenn@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-27 01:43:21 +02:00

27 lines
620 B
C

#if defined(__i386__) || defined(__x86_64__)
#include "helpers/helpers.h"
int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
int *states)
{
struct cpupower_cpu_info cpu_info;
int ret;
*support = *active = *states = 0;
ret = get_cpu_info(0, &cpu_info);
if (ret)
return ret;
if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
*support = 1;
ret = amd_pci_get_num_boost_states(active, states);
if (ret)
return ret;
} else if (cpupower_cpu_info.caps & CPUPOWER_CAP_INTEL_IDA)
*support = *active = 1;
return 0;
}
#endif /* #if defined(__i386__) || defined(__x86_64__) */