Linux Power Management development
 help / color / mirror / Atom feed
From: Sherry Hurwitz <sherry.hurwitz@amd.com>
To: trenn@suse.com
Cc: linux-pm@vger.kernel.org
Subject: [PATCH 1/2] cpupower: Fix bug where return value was not used
Date: Tue, 20 Jun 2017 02:07:37 -0500	[thread overview]
Message-ID: <20170620070241.21434.57148.stgit@Diesel2540.amd.com> (raw)
In-Reply-To: <20170620065708.21434.80154.stgit@Diesel2540.amd.com>

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>
---
 tools/power/cpupower/utils/helpers/misc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c
index 1609243..6952a6a 100644
--- a/tools/power/cpupower/utils/helpers/misc.c
+++ b/tools/power/cpupower/utils/helpers/misc.c
@@ -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;

  reply	other threads:[~2017-06-20  7:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20  7:02 [PATCH 0/2] Series short description Sherry Hurwitz
2017-06-20  7:07 ` Sherry Hurwitz [this message]
2017-06-23 14:00   ` [PATCH 1/2] cpupower: Fix bug where return value was not used Thomas Renninger
2017-06-23 23:03     ` Rafael J. Wysocki
2017-06-20  7:08 ` [PATCH 2/2] cpupower: Add support for new AMD family 0x17 Sherry Hurwitz
2017-06-23 14:04   ` Thomas Renninger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170620070241.21434.57148.stgit@Diesel2540.amd.com \
    --to=sherry.hurwitz@amd.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=trenn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox