From patchwork Tue Feb 9 03:46:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 61484 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1808352lbl; Mon, 8 Feb 2016 19:48:27 -0800 (PST) X-Received: by 10.66.124.200 with SMTP id mk8mr47901466pab.43.1454989705826; Mon, 08 Feb 2016 19:48:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yo8si50948626pac.27.2016.02.08.19.48.25; Mon, 08 Feb 2016 19:48:25 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755870AbcBIDsU (ORCPT + 11 others); Mon, 8 Feb 2016 22:48:20 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35610 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755884AbcBIDr4 (ORCPT ); Mon, 8 Feb 2016 22:47:56 -0500 Received: by mail-pf0-f179.google.com with SMTP id c10so53706552pfc.2 for ; Mon, 08 Feb 2016 19:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=c8oJMk8HykieqOENYfn1RDPIDNZcFD7Sn9WKNS+JTAM=; b=dIomWipfV/Qlk6sXe6Xnx/MV57DNnHmGSrZydS7ZtUjMCxqEzu3Ond261jmPDzJQz9 KtL01sWVFnNOUk4AOOcogPeC3A1xbX9udBfmj6awzCdW2r9Le/vEv1Gni8NJCKMg6FIn 2sBVToP/IZi88RCphB13gaWf5rbbQXkQgRBGc= 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:in-reply-to :references:in-reply-to:references; bh=c8oJMk8HykieqOENYfn1RDPIDNZcFD7Sn9WKNS+JTAM=; b=GyYyu33KiUz+MFOuKl535YSNEo9+STqhiMByEjKOJgbQmvcJFg3kqYTiukFRG2Agdu 80WHCJ17wJpTyoryLH4m/Npf1JAmNtuqnbP3NNIYpj5wUIRasUZBNlLki22dDH8fcxP5 7mu/Qvwb8NgdUFvz0Vx4aV3fw47+clj5WYuCtmsLimejgAMYkT6K68X5TcIn8THklbDK AykVh5ltwB2wiFB8qQ+toy9biCM4S2si5uYngaTgLamX4mshMcpI8sfsnb2iQM8Th8MI oDfgT7Q59+ykz8FPHE1R7ozmL7Lfi79EK9G2/si26h455nxNN5Z31pRLPMRgtZvIa6yz 6NEg== X-Gm-Message-State: AG10YOSA2d/4pQyeiXkHpJ76+ibayjNRzPRlhfdATEmQqygKF5fDqx2VAQxWZBvii5SsV6S8 X-Received: by 10.98.64.202 with SMTP id f71mr47441526pfd.113.1454989676395; Mon, 08 Feb 2016 19:47:56 -0800 (PST) Received: from localhost ([122.172.22.246]) by smtp.gmail.com with ESMTPSA id t29sm46530711pfi.8.2016.02.08.19.47.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 19:47:55 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , juri.lelli@arm.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, shilpa.bhat@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V4 7/7] cpufreq: ondemand: Rearrange od_dbs_timer() to void updating delay Date: Tue, 9 Feb 2016 09:16:19 +0530 Message-Id: <853c8f6925a75e3750d3f0a0facd0d1d3f4325ba.1454988792.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.370.gb2aa7f8 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 'delay' is updated properly in all paths of the routine od_dbs_timer(), leaving just one. And can be 0 only in that case. Move the update to 'delay' as an else part of the if block. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_ondemand.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.7.1.370.gb2aa7f8 -- 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 diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index d9f323f150c4..388ae07ce413 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -194,7 +194,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) struct policy_dbs_info *policy_dbs = policy->governor_data; struct dbs_data *dbs_data = policy_dbs->dbs_data; struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu); - int delay = 0, sample_type = dbs_info->sample_type; + int delay, sample_type = dbs_info->sample_type; /* Common NORMAL_SAMPLE setup */ dbs_info->sample_type = OD_NORMAL_SAMPLE; @@ -208,13 +208,12 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) /* Setup timer for SUB_SAMPLE */ dbs_info->sample_type = OD_SUB_SAMPLE; delay = dbs_info->freq_hi_jiffies; + } else { + delay = delay_for_sampling_rate(dbs_data->sampling_rate + * dbs_info->rate_mult); } } - if (!delay) - delay = delay_for_sampling_rate(dbs_data->sampling_rate - * dbs_info->rate_mult); - return delay; }