From patchwork Wed Nov 26 05:53:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41526 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B08C525E72 for ; Wed, 26 Nov 2014 05:53:49 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf1322848wgh.2 for ; Tue, 25 Nov 2014 21:53:49 -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=4UlBWN5wzUNU5YbL6EGAS8zMlrmWjZt7wN1V9kiHP4o=; b=K4DhrwbQ8hb+4xhQT5Q0nVINvTlhxCQp3/RCsdibbvk4EiGavyRPi8Vu9BhABWq/7e CQ0OS0HQxxzijZfm3lSXct8J5uK2qg/kBJQ4v7zGHkcHqjtkLHOTt1IZhwbLQS8RhiFZ gV4x8VtQMlKqCaSfGJ72xgWYBaZ6mEu33AJytGHW4LBMr9WS/EsjYabUiLgHwtopQaoC UuoEOPqWFnOgnzYIKBRewZGdY7N/9uZupr9IUc6/q8TkLWeUphZc06thAtPVukolvGGy iHMQtaTz488DIttoyujqRkcKXGcxfCcvKhvaIRrIAjZBjnDGENolBB8n06nXkMue8b9h DVug== X-Gm-Message-State: ALoCoQmR0uokq2B5ev1nX/zePBywUpbw67KluOgOaP3NUgYfePAH/lE5nvWn7wchaodDYJNea6AV X-Received: by 10.180.206.77 with SMTP id lm13mr393120wic.4.1416981229025; Tue, 25 Nov 2014 21:53:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls557921laa.49.gmail; Tue, 25 Nov 2014 21:53:48 -0800 (PST) X-Received: by 10.112.25.73 with SMTP id a9mr32889089lbg.10.1416981228643; Tue, 25 Nov 2014 21:53:48 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id 4si3290684laq.88.2014.11.25.21.53.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 21:53:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gf13so1863584lab.14 for ; Tue, 25 Nov 2014 21:53:48 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr8638832lal.29.1416981228538; Tue, 25 Nov 2014 21:53:48 -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 ew9csp572442lbc; Tue, 25 Nov 2014 21:53:47 -0800 (PST) X-Received: by 10.70.63.9 with SMTP id c9mr50720711pds.104.1416981226971; Tue, 25 Nov 2014 21:53:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl2si5023000pad.233.2014.11.25.21.53.46 for ; Tue, 25 Nov 2014 21:53:46 -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 S1752243AbaKZFxp (ORCPT + 12 others); Wed, 26 Nov 2014 00:53:45 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:44693 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752240AbaKZFxp (ORCPT ); Wed, 26 Nov 2014 00:53:45 -0500 Received: by mail-pa0-f52.google.com with SMTP id eu11so2154816pac.39 for ; Tue, 25 Nov 2014 21:53:44 -0800 (PST) X-Received: by 10.70.21.168 with SMTP id w8mr50097704pde.95.1416981224808; Tue, 25 Nov 2014 21:53:44 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id dp3sm3121757pdb.46.2014.11.25.21.53.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 21:53:44 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, l.majewski@samsung.com, Viresh Kumar Subject: [PATCH 7/7] cpu_cooling: Don't check is_cpufreq_valid() Date: Wed, 26 Nov 2014 11:23:02 +0530 Message-Id: <5cd24c81a5e23f68ac499605bd6647c0045f222a.1416980448.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.41 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 41f5728..3740b61 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -98,23 +98,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, @@ -288,8 +271,7 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, cpufreq_device->cpufreq_val = clip_freq; notify_device = cpufreq_device; - if (is_cpufreq_valid(cpu)) - cpufreq_update_policy(cpu); + cpufreq_update_policy(cpu); notify_device = NOTIFY_INVALID;