From patchwork Fri Nov 28 09:44:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 061F4244C2 for ; Fri, 28 Nov 2014 09:45:36 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf3884374lbd.6 for ; Fri, 28 Nov 2014 01:45:34 -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=dbW4CgUatuQSbhu7s09r1PNezZSvdVUi37tVGkLlOg0=; b=GGMCudHr6j7cku3cWDXetkq7NyO8XZVLHJ/2teHNEIxcUMyuWMKuEdDU4QRW/pTjlD /9x3urCtg+ym8uOAhf1+RdJuezgUbGTe6Q5BTEomxaiyOYdQuYL3aMdb1XPpIqWbo25j pmUB5FIEh31vtH4Gc2i40qR4/A0vMApn+PfcDYcY2UXsEJQyzU7SLeHOu3W8j3RgLTFL spbgj+y2reW92z5dZ8NQxMImpie12jkKOwM+lYHEsabp2wRa6DYhDNdDeAGn3kV7smrK 8oJp4CkDRY6ZaQuONpXg6FjDSS6usdVo8xbFp5PYmNegzWSbYaIH9jWIE3Rni7u4U++n MXtg== X-Gm-Message-State: ALoCoQltGCWVQoMHO/ZATS6IIoVtNfYZ+mLWBnWuTYojGrp5Mtb2OU4qnfdN22tBz+WCmyXrYUj0 X-Received: by 10.180.8.9 with SMTP id n9mr9748843wia.6.1417167934756; Fri, 28 Nov 2014 01:45:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.39 with SMTP id f7ls860907lab.75.gmail; Fri, 28 Nov 2014 01:45:34 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr42330335lbc.66.1417167934629; Fri, 28 Nov 2014 01:45:34 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id j1si9461701lah.68.2014.11.28.01.45.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so5128948lbg.8 for ; Fri, 28 Nov 2014 01:45:34 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr42911905lbc.34.1417167934550; Fri, 28 Nov 2014 01:45:34 -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 ew9csp60455lbc; Fri, 28 Nov 2014 01:45:33 -0800 (PST) X-Received: by 10.70.38.71 with SMTP id e7mr43353226pdk.130.1417167932739; Fri, 28 Nov 2014 01:45:32 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vj10si15336419pbc.138.2014.11.28.01.45.32 for ; Fri, 28 Nov 2014 01:45:32 -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 S1751762AbaK1Jpb (ORCPT + 12 others); Fri, 28 Nov 2014 04:45:31 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:40535 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbaK1Jpa (ORCPT ); Fri, 28 Nov 2014 04:45:30 -0500 Received: by mail-pa0-f54.google.com with SMTP id fb1so6568622pad.13 for ; Fri, 28 Nov 2014 01:45:29 -0800 (PST) X-Received: by 10.70.90.140 with SMTP id bw12mr71224717pdb.127.1417167929702; Fri, 28 Nov 2014 01:45:29 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id id2sm9337267pbb.65.2014.11.28.01.45.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:45:29 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, Viresh Kumar Subject: [PATCH 14/26] cpu_cooling: Don't check is_cpufreq_valid() Date: Fri, 28 Nov 2014 15:14:08 +0530 Message-Id: <4104dfae900b639da7d7eb0e097e4a4e2a6970ad.1417167599.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.217.177 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 8ca0380..41aa7d5 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -111,23 +111,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, @@ -302,8 +285,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;