From patchwork Mon Nov 14 07:00:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 82013 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp876627qge; Sun, 13 Nov 2016 23:01:02 -0800 (PST) X-Received: by 10.98.220.75 with SMTP id t72mr33002767pfg.164.1479106862458; Sun, 13 Nov 2016 23:01:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp7si17611153pab.224.2016.11.13.23.01.02; Sun, 13 Nov 2016 23:01:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138AbcKNHBB (ORCPT + 13 others); Mon, 14 Nov 2016 02:01:01 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:34206 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752035AbcKNHBA (ORCPT ); Mon, 14 Nov 2016 02:01:00 -0500 Received: by mail-pf0-f181.google.com with SMTP id c4so15998393pfb.1 for ; Sun, 13 Nov 2016 23:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=AJvNRhunzWainJ/o3qJpxJWJ4LsWskzU2SOlrId9v/U=; b=MIIDb3Fs417LuimQ/Z4QPg+6fuXQSpCjBzgIp9g1GuPEabRdnY++tMO8F+11FIrcoD KfKih2Y2Yag0N0+ut6lFJP9mR+QMPSqSM00lFG6uxEhKZy/aaQXHFartd66VGbHNqINA WRyeLaJS4eu+lnp32lJNYXb4ZAar7jJDrXseM= 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=AJvNRhunzWainJ/o3qJpxJWJ4LsWskzU2SOlrId9v/U=; b=L842+ISudHaQMF/bwPKkcw9DsTxvzXO5wMlfSX2Pm9hloY3P76E7Cg6YZHR5UVD1Hk iyrOAl4OdM2NqaQFtOmd1qOaVwWzAEuOjXotiaPOFsN/P2lksu60d69PHeXI2TOCJK/b +g71m0ZLQ4FPKd/zlf3daKIYrgrDK2dBxW6G27K8XzNm6I1hQ2vhBFyBkIkQ6rAy/tX/ 6vsC3WFOd6ycGtUJRcqzAlYKH+fmHRixSwu1YqQpV+OlziHw26mwnsB7pYIsI+Eao+LU 6z++X8N8MPlxkVSV8adJgj/KXALNjdBtooydJ7wkXiJU5fHpfTm63YGlFltJvWWLTh5c TKQw== X-Gm-Message-State: ABUngvdO7ZrgL7BUrMN4amAzwEhqWk1ZT2lunL7wwJVmjxpHHr2/bcvCdAgcT42E3KsDaFJW X-Received: by 10.99.232.17 with SMTP id s17mr66671980pgh.127.1479106859374; Sun, 13 Nov 2016 23:00:59 -0800 (PST) Received: from localhost ([122.172.89.192]) by smtp.gmail.com with ESMTPSA id b126sm32348069pfg.90.2016.11.13.23.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2016 23:00:58 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , stratosk@semaphore.gr Subject: [PATCH] cpufreq: conservative: Rename get_freq_target() to get_freq_step() Date: Mon, 14 Nov 2016 12:30:43 +0530 Message-Id: <4f72891a684f0a8510e8b9560e2d7922b133d591.1479106815.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org What's returned from this function is the delta by which the frequency must be increased or decreased and not the final frequency that should be selected. Name it properly to match its purpose. Also update the variables used to store that value. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_conservative.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.7.1.410.g6faf27b -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index fa5ece3915a1..0681fcff5aae 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -37,16 +37,16 @@ struct cs_dbs_tuners { #define DEF_SAMPLING_DOWN_FACTOR (1) #define MAX_SAMPLING_DOWN_FACTOR (10) -static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners, - struct cpufreq_policy *policy) +static inline unsigned int get_freq_step(struct cs_dbs_tuners *cs_tuners, + struct cpufreq_policy *policy) { - unsigned int freq_target = (cs_tuners->freq_step * policy->max) / 100; + unsigned int freq_step = (cs_tuners->freq_step * policy->max) / 100; /* max freq cannot be less than 100. But who knows... */ - if (unlikely(freq_target == 0)) - freq_target = DEF_FREQUENCY_STEP; + if (unlikely(freq_step == 0)) + freq_step = DEF_FREQUENCY_STEP; - return freq_target; + return freq_step; } /* @@ -90,7 +90,7 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy) if (requested_freq == policy->max) goto out; - requested_freq += get_freq_target(cs_tuners, policy); + requested_freq += get_freq_step(cs_tuners, policy); if (requested_freq > policy->max) requested_freq = policy->max; @@ -106,16 +106,16 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy) /* Check for frequency decrease */ if (load < cs_tuners->down_threshold) { - unsigned int freq_target; + unsigned int freq_step; /* * if we cannot reduce the frequency anymore, break out early */ if (requested_freq == policy->min) goto out; - freq_target = get_freq_target(cs_tuners, policy); - if (requested_freq > freq_target) - requested_freq -= freq_target; + freq_step = get_freq_step(cs_tuners, policy); + if (requested_freq > freq_step) + requested_freq -= freq_step; else requested_freq = policy->min;