From patchwork Thu Dec 4 04:11:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41899 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65A5325E88 for ; Thu, 4 Dec 2014 04:13:48 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf10539470wid.3 for ; Wed, 03 Dec 2014 20:13:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=XB20QPzYG6unvptK8jQZ9ehllaRbZg7TIL7yy+MXGUw=; b=URVu38WLiZZI2ut0Cw1WZO89pP8po7LcGmjZVmMsYAr9vAx1LnKkaoe+V2Bf/c8nsB siRLKhecpDXMS9EoMN15Nv/m2mRF3/gtk8m61FgYUKJ+1/Ki6E9+teI69BmPG2kOTavd eCXq55L9s3L7moyAD+TXa8wtbEcYkRs9tQO/58whBXNizXI8IyauU+toWHCaFIPq7IIo nkVnU4rf98dY1tGubJ5zxjXzTno9r95T379TY31JQkS6bq40/4DrR6JD7fR5FJOArFyj Z0YJ0bz44cLWNpTffv/Smt6HCuxv71F1Zr4ReickQc3xlrPCm1XQQBw6SsBMTqBKaFsn n7Bg== X-Gm-Message-State: ALoCoQmkec7XAquQFrqLWjvaDb0IQySnVBqIi//q7lGEhbp39/QWCiNF8RbaMR3BqY7KifSzoGuf X-Received: by 10.180.24.131 with SMTP id u3mr2820818wif.4.1417666427620; Wed, 03 Dec 2014 20:13:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.134 with SMTP id ay6ls234934lab.107.gmail; Wed, 03 Dec 2014 20:13:47 -0800 (PST) X-Received: by 10.152.28.131 with SMTP id b3mr7600983lah.12.1417666427409; Wed, 03 Dec 2014 20:13:47 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ue9si24664553lbb.41.2014.12.03.20.13.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 20:13:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so13437074lab.22 for ; Wed, 03 Dec 2014 20:13:47 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr7248138lal.29.1417666427297; Wed, 03 Dec 2014 20:13:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp781071lbc; Wed, 3 Dec 2014 20:13:45 -0800 (PST) X-Received: by 10.68.241.130 with SMTP id wi2mr21943931pbc.89.1417666425179; Wed, 03 Dec 2014 20:13:45 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id df1si18139882pdb.237.2014.12.03.20.13.44 for ; Wed, 03 Dec 2014 20:13:45 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753004AbaLDENn (ORCPT + 12 others); Wed, 3 Dec 2014 23:13:43 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:40599 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbaLDENn (ORCPT ); Wed, 3 Dec 2014 23:13:43 -0500 Received: by mail-pa0-f54.google.com with SMTP id fb1so17101786pad.41 for ; Wed, 03 Dec 2014 20:13:43 -0800 (PST) X-Received: by 10.70.102.145 with SMTP id fo17mr15298675pdb.48.1417666423089; Wed, 03 Dec 2014 20:13:43 -0800 (PST) Received: from localhost ([122.166.92.172]) by mx.google.com with ESMTPSA id qd10sm24365690pbc.86.2014.12.03.20.13.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 20:13:42 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, amit.daniel@samsung.com, javi.merino@arm.com, Viresh Kumar Subject: [PATCH V2 15/26] thermal: cpu_cooling: Don't check is_cpufreq_valid() Date: Thu, 4 Dec 2014 09:41:57 +0530 Message-Id: <3657df96fb462fc1825817f346edb68d42da9b55.1417664938.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Because get_cpu_frequency() has returned a valid frequency, it means that the cpufreq policy is surely valid and so no point checking that again with is_cpufreq_valid(). Get rid of the routine as well as there are no more users. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 7f27f1b..1dd4cc4 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -110,23 +110,6 @@ static void release_idr(struct idr *idr, int id) /* Below code defines functions to be used for cpufreq as cooling device */ -/** - * is_cpufreq_valid - function to check frequency transitioning capability. - * @cpu: cpu for which check is needed. - * - * This function will check the current state of the system if - * it is capable of changing the frequency for a given @cpu. - * - * Return: 0 if the system is not currently capable of changing - * the frequency of given cpu. !0 in case the frequency is changeable. - */ -static int is_cpufreq_valid(int cpu) -{ - struct cpufreq_policy policy; - - return !cpufreq_get_policy(&policy, cpu); -} - enum cpufreq_cooling_property { GET_LEVEL, GET_FREQ, @@ -300,8 +283,7 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, cpufreq_device->cpufreq_state = cooling_state; cpufreq_device->cpufreq_val = clip_freq; - if (is_cpufreq_valid(cpu)) - cpufreq_update_policy(cpu); + cpufreq_update_policy(cpu); return 0; }