From patchwork Mon Aug 26 18:37:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 2849747 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50129BF546 for ; Mon, 26 Aug 2013 18:47:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48F46202EC for ; Mon, 26 Aug 2013 18:47:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3898F202CF for ; Mon, 26 Aug 2013 18:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166Ab3HZSr0 (ORCPT ); Mon, 26 Aug 2013 14:47:26 -0400 Received: from sema.semaphore.gr ([78.46.194.137]:44499 "EHLO sema.semaphore.gr" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752103Ab3HZSrZ (ORCPT ); Mon, 26 Aug 2013 14:47:25 -0400 X-Greylist: delayed 592 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Aug 2013 14:47:25 EDT Received: from albert.lan (adsl-89.109.242.250.tellas.gr [109.242.250.89]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: stratosk) by sema.semaphore.gr (Postfix) with ESMTPSA id E736582B8E; Mon, 26 Aug 2013 20:37:29 +0200 (CEST) Message-ID: <521BA068.8030003@semaphore.gr> Date: Mon, 26 Aug 2013 21:37:28 +0300 From: Stratos Karafotis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: "Rafael J. Wysocki" , Viresh Kumar CC: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, LKML Subject: [PATCH] cpufreq: governors: Remove duplicate check of target freq in supported range Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Function __cpufreq_driver_target checks if target_freq is within policy->min and policy->max range. generic_powersave_bias_target also checks if target_freq is valid through cpufreq_frequency_table_target call. So, drop the unnecessary duplicate check in *_check_cpu functions. Signed-off-by: Stratos Karafotis Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq_conservative.c | 4 ---- drivers/cpufreq/cpufreq_ondemand.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 7f67a75..f62d822 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -67,8 +67,6 @@ static void cs_check_cpu(int cpu, unsigned int load) return; dbs_info->requested_freq += get_freq_target(cs_tuners, policy); - if (dbs_info->requested_freq > policy->max) - dbs_info->requested_freq = policy->max; __cpufreq_driver_target(policy, dbs_info->requested_freq, CPUFREQ_RELATION_H); @@ -89,8 +87,6 @@ static void cs_check_cpu(int cpu, unsigned int load) return; dbs_info->requested_freq -= get_freq_target(cs_tuners, policy); - if (dbs_info->requested_freq < policy->min) - dbs_info->requested_freq = policy->min; __cpufreq_driver_target(policy, dbs_info->requested_freq, CPUFREQ_RELATION_L); diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 87f3305..32f26f6 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -177,9 +177,6 @@ static void od_check_cpu(int cpu, unsigned int load) /* No longer fully busy, reset rate_mult */ dbs_info->rate_mult = 1; - if (freq_next < policy->min) - freq_next = policy->min; - if (!od_tuners->powersave_bias) { __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);