cpupower: Fix bug where return value was not used
authorSherry Hurwitz <sherry.hurwitz@amd.com>
Tue, 20 Jun 2017 07:07:37 +0000 (02:07 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 Jun 2017 23:43:21 +0000 (01:43 +0200)
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>
tools/power/cpupower/utils/helpers/misc.c

index 1609243..6952a6a 100644 (file)
@@ -16,10 +16,9 @@ int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
 
        if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
                *support = 1;
-               amd_pci_get_num_boost_states(active, states);
-               if (ret <= 0)
+               ret = amd_pci_get_num_boost_states(active, states);
+               if (ret)
                        return ret;
-               *support = 1;
        } else if (cpupower_cpu_info.caps & CPUPOWER_CAP_INTEL_IDA)
                *support = *active = 1;
        return 0;