From patchwork Tue Jun 20 07:07:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Hurwitz X-Patchwork-Id: 9798645 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EC8E60328 for ; Tue, 20 Jun 2017 07:07:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 334A3283B4 for ; Tue, 20 Jun 2017 07:07:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27E6528438; Tue, 20 Jun 2017 07:07:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9657F283B4 for ; Tue, 20 Jun 2017 07:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbdFTHHk (ORCPT ); Tue, 20 Jun 2017 03:07:40 -0400 Received: from [165.204.78.1] ([165.204.78.1]:16054 "EHLO diesel2540.amd.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751126AbdFTHHk (ORCPT ); Tue, 20 Jun 2017 03:07:40 -0400 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Tue, 20 Jun 2017 03:07:40 EDT Received: from Diesel2540.amd.com (localhost [IPv6:::1]) by diesel2540.amd.com (Postfix) with ESMTP id A91E43104176; Tue, 20 Jun 2017 02:07:37 -0500 (CDT) Subject: [PATCH 1/2] cpupower: Fix bug where return value was not used From: Sherry Hurwitz To: trenn@suse.com Cc: linux-pm@vger.kernel.org Date: Tue, 20 Jun 2017 02:07:37 -0500 Message-ID: <20170620070241.21434.57148.stgit@Diesel2540.amd.com> In-Reply-To: <20170620065708.21434.80154.stgit@Diesel2540.amd.com> References: <20170620065708.21434.80154.stgit@Diesel2540.amd.com> User-Agent: StGit/0.17.1-26-g90d5 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Save return value from amd_pci_get_num_boost_states and remove redundant setting of *support Signed-off-by: Sherry Hurwitz Acked-by: Thomas Renninger Reviewed-by: Thomas Renninger --- 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;