From patchwork Sun Sep 4 22:59:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Noonan X-Patchwork-Id: 9312921 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 0F44A600CA for ; Sun, 4 Sep 2016 22:59:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB22F2882C for ; Sun, 4 Sep 2016 22:59:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF4FA2882F; Sun, 4 Sep 2016 22:59:30 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 616DD2882C for ; Sun, 4 Sep 2016 22:59:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbcIDW73 (ORCPT ); Sun, 4 Sep 2016 18:59:29 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36024 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbcIDW72 (ORCPT ); Sun, 4 Sep 2016 18:59:28 -0400 Received: by mail-pa0-f67.google.com with SMTP id ez1so8351526pab.3 for ; Sun, 04 Sep 2016 15:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uplinklabs-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Z9XQ1UvsvWr5GufT2EnRy7ZRR1nrBiF/z+74jJP8u6k=; b=sLs0xov79n2gZJMEa7XvPB102nH/QSYJ7UJfrefa3RF/wVm8NSGMxgzCL2JiveKYbW UERpASlq4RERIsazaXhNzrZgnZbW5lBiunuSUNZxAxNLFu7hDFKK+cHORSZep1XShotN eOHzUwtzgTepXiS3jGYJ9U5xPE6Zj05mQAS+M3Br1MUbGjS/2ZvzF1m4KZCcdiT6pmB2 iTe6dKITkbmqISxgR3aw5LPazq8uJET+uvJpEj4ug+qBLD/wPrdRdcs7hJQpSf5SYp+F cdqqIIb7OkSDnNsM6NBiTZ/TOzwmk/d9PhY2eYebwDJVfl273ZzS8hC9aq1gdeiondQD fVVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Z9XQ1UvsvWr5GufT2EnRy7ZRR1nrBiF/z+74jJP8u6k=; b=mRNE6K47Vpf/rxt3qeB7oOCjA1S0qw+0X6ndsFIjHC0KTmRZevDs0mfQiBlc7IWS6J cPNHLVbne1XUdmROuv7/z1BttaYv4AqYUIOFRhyy+zin2jWnqodRZnBwCE7KBVVyXIJU p8MYbsTh9T5uK3HEAiS77INhBj+9ih9Vd5c3yppAeARrZYR4rMqapObEMhQiIjyH2kEO 0A8SaNuhu+aZ14R4dvbQIa1uAezqiNKXPTMNj2/uDwE14X2xWtXhwvpgpI61E9vwcnh6 DqHPxqaqE9L6acnWuGxkOznk3pgiIMioUgmMAhp40RTLO0dSkhYTgWlXF7mJIRqkTnEI aGEQ== X-Gm-Message-State: AE9vXwPR6noYlBAnhKXWFOCaVb9U3Z+grjEvBERGDfSqMqVn+oN79jlEPMhKaWzRHbXCmA== X-Received: by 10.66.126.131 with SMTP id my3mr50557954pab.115.1473029967722; Sun, 04 Sep 2016 15:59:27 -0700 (PDT) Received: from localhost ([2604:4080:1004:0:225:90ff:fe15:52df]) by smtp.gmail.com with ESMTPSA id 67sm23740883pfy.80.2016.09.04.15.59.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 15:59:26 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Sun, 04 Sep 2016 15:59:24 -0700 From: Steven Noonan To: linux-pm@vger.kernel.org Cc: Thomas Renninger , Steven Noonan Subject: [PATCH] cpupower: fix bench check for online CPUs Date: Sun, 4 Sep 2016 15:59:23 -0700 Message-Id: <20160904225923.27993-1-steven@uplinklabs.net> X-Mailer: git-send-email 2.9.3 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 Another case of incorrectly assuming the same return values as 'cpufreq_cpu_exists' (which used to return 0 on success). Signed-off-by: Steven Noonan --- tools/power/cpupower/bench/system.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/power/cpupower/bench/system.c b/tools/power/cpupower/bench/system.c index c25a74a..b05a979 100644 --- a/tools/power/cpupower/bench/system.c +++ b/tools/power/cpupower/bench/system.c @@ -61,9 +61,9 @@ int set_cpufreq_governor(char *governor, unsigned int cpu) dprintf("set %s as cpufreq governor\n", governor); - if (cpupower_is_cpu_online(cpu) != 0) { - perror("cpufreq_cpu_exists"); - fprintf(stderr, "error: cpu %u does not exist\n", cpu); + if (cpupower_is_cpu_online(cpu) != 1) { + perror("cpufreq_is_cpu_online"); + fprintf(stderr, "error: cpu %u is not online\n", cpu); return -1; }