From patchwork Fri Sep 9 17:25:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9324017 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 721CB60752 for ; Fri, 9 Sep 2016 17:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6237229F94 for ; Fri, 9 Sep 2016 17:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5531129F96; Fri, 9 Sep 2016 17:25:31 +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=-4.5 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 C41CC29F94 for ; Fri, 9 Sep 2016 17:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752AbcIIRZ3 (ORCPT ); Fri, 9 Sep 2016 13:25:29 -0400 Received: from mail-yw0-f173.google.com ([209.85.161.173]:35457 "EHLO mail-yw0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbcIIRZ2 (ORCPT ); Fri, 9 Sep 2016 13:25:28 -0400 Received: by mail-yw0-f173.google.com with SMTP id j1so51008807ywb.2 for ; Fri, 09 Sep 2016 10:25:27 -0700 (PDT) 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=FuYkZw3iqTjnkiioDuefqc/99Koy1H7x5GpDWAy/rPM=; b=GSu4nJdZT/TKAOU4Ef1GjJX9MzH0SiD/Q54OjM6H2eXhEakti40fbOuiMivgecBvFE hRI8Iwt1obHTFB8zLJR/0ncGnQblcvBWbKgY1v8C/d0A2+G0e3zySLlLEOa0oXK0iyNV f8cTIM1XOPBQd5MY19EyzmA5sd269rMjgnx1irNkXujQKg0pNYJ8zMSLnomF38g/6jpO Hq8+7E2/6MIUHGwT+WkFmV74Q0g5t5WUY517wz1gsykfiYp/h7DxWt7c2YRygMh/uOYe Dg8y/uaJgOnjikG9TOIomC5QKuQBoyvSS00bQ8hsgfI5M320G3+gKMLC23iO9LeY4zM+ qf2w== X-Gm-Message-State: AE9vXwPPw4p3dEj6awxNKKS7n6ducen60XrrWMhZN4O0kBAXxJy9CSX9SXLGHrJoVO9ub+5z X-Received: by 10.129.119.196 with SMTP id s187mr4273868ywc.42.1473441927381; Fri, 09 Sep 2016 10:25:27 -0700 (PDT) Received: from labbott-redhat-machine.redhat.com ([2601:602:9800:177f::2946]) by smtp.gmail.com with ESMTPSA id d203sm1503797ywe.32.2016.09.09.10.25.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 10:25:26 -0700 (PDT) From: Laura Abbott To: Thomas Renninger Cc: Laura Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpupower: Correct return type of cpu_power_is_cpu_online in cpufreq Date: Fri, 9 Sep 2016 10:25:19 -0700 Message-Id: <1473441919-7809-1-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 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 When converting to a shared library in ac5a181d065d ("cpupower: Add cpuidle parts into library"), cpu_freq_cpu_exists was converted to cpupower_is_cpu_online. cpu_req_cpu_exists returned 0 on success and -ENOSYS on failure whereas cpupower_is_cpu_online returns 1 on success. Check for the correct return value in cpufreq-set. See https://bugzilla.redhat.com/show_bug.cgi?id=1374212 Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library") Reported-by: Julian Seward Signed-off-by: Laura Abbott --- tools/power/cpupower/utils/cpufreq-set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c index b4bf769..8971d71 100644 --- a/tools/power/cpupower/utils/cpufreq-set.c +++ b/tools/power/cpupower/utils/cpufreq-set.c @@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv) struct cpufreq_affected_cpus *cpus; if (!bitmask_isbitset(cpus_chosen, cpu) || - cpupower_is_cpu_online(cpu)) + cpupower_is_cpu_online(cpu) != 1) continue; cpus = cpufreq_get_related_cpus(cpu); @@ -316,7 +316,7 @@ int cmd_freq_set(int argc, char **argv) cpu <= bitmask_last(cpus_chosen); cpu++) { if (!bitmask_isbitset(cpus_chosen, cpu) || - cpupower_is_cpu_online(cpu)) + cpupower_is_cpu_online(cpu) != 1) continue; if (cpupower_is_cpu_online(cpu) != 1)