From patchwork Tue May 31 11:19:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 68917 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1883638qge; Tue, 31 May 2016 04:23:11 -0700 (PDT) X-Received: by 10.66.66.42 with SMTP id c10mr54067868pat.119.1464693790997; Tue, 31 May 2016 04:23:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s207si43293064pfs.76.2016.05.31.04.23.10; Tue, 31 May 2016 04:23:10 -0700 (PDT) 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 S1751293AbcEaLXJ (ORCPT + 14 others); Tue, 31 May 2016 07:23:09 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35435 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbcEaLTt (ORCPT ); Tue, 31 May 2016 07:19:49 -0400 Received: by mail-pa0-f43.google.com with SMTP id fy7so54063980pac.2 for ; Tue, 31 May 2016 04:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=iAOU1BWzYhWceK2oOqoXjnS2+w2v4TkEQ8p+/zAUiA4=; b=cNu0oINikcZ504IZJndszOxbo3o3LHO4tIi/cm0hprMf7fYLyX7s56mut6kXhX9b8J +7tDEtFzcjrqVRFdFb15Zma0NyadbBK7KTi+0Tbtiw7dGbhFIPOHJ6qIoM0tJ9CTg8Cy l+bLSQawvFR2RNaDOQ6W40Fm/q0uCfnIdSAo4= 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=iAOU1BWzYhWceK2oOqoXjnS2+w2v4TkEQ8p+/zAUiA4=; b=kNEy/79fW7WvJtDUH+dHN/eSD7vYHs9DyD+e0ab9WNfeh5/Z8pwJQ4mNuhpgNw8lYm RYpFOP1SEdmJt1I3CjNcDZTLYVIrvxedmjjI1s5cvjCeC00HrtOcN7MN8e/ew4l/g8PB VOg3y1y/OpDtgZ9sNM7j8K55ArK5X91ctrNB/Zj+gDAnKJO3WCNuX08LaG9zma/uxPja 29jFxkYCJanznyzVSp+hYuJQiQdeVajPR5WhpajG39u5Gx9Z8HP6NbB8kzk841z1gfkP dHHV8u8RIvhr6ISkr7Xt9nasw2fNuIpURPJJ3wpDrHto/vfle2oonOxqECRaLV3jyv+z YmaQ== X-Gm-Message-State: ALyK8tK4qdsRgj/IbY3uZlGo0qh1XhakG9A/B7MphaK/UMGYautMG0Q9UX0URhWLwnnBJepC X-Received: by 10.66.62.196 with SMTP id a4mr15453234pas.25.1464693588810; Tue, 31 May 2016 04:19:48 -0700 (PDT) Received: from localhost ([122.167.19.26]) by smtp.gmail.com with ESMTPSA id z12sm39677054pfj.1.2016.05.31.04.19.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 May 2016 04:19:47 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: Fix incorrect usage of clamp_val() Date: Tue, 31 May 2016 16:49:42 +0530 Message-Id: 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 clamp_val() doesn't change anything by itself, rather it returns the clamped value. Fix it. Fixes: 0ac587b32f49 ("cpufreq: Use clamp_val() in __cpufreq_driver_target()") Signed-off-by: Viresh Kumar --- Hi Rafael, Please merge this with the offending commit if you are fine with rebase, else apply this one as well. Sorry for blindly copying code. drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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 Acked-by: Viresh Kumar diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d0c02a7eec0f..c6a14ba239a2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1927,7 +1927,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, return -ENODEV; /* Make sure that target_freq is within supported range */ - clamp_val(target_freq, policy->min, policy->max); + target_freq = clamp_val(target_freq, policy->min, policy->max); pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", policy->cpu, target_freq, relation, old_target_freq);