From patchwork Wed Feb 10 07:00:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 61618 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2474497lbl; Tue, 9 Feb 2016 23:00:47 -0800 (PST) X-Received: by 10.98.64.4 with SMTP id n4mr43311685pfa.58.1455087647693; Tue, 09 Feb 2016 23:00:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si3094444pfa.186.2016.02.09.23.00.47; Tue, 09 Feb 2016 23:00:47 -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 S1757100AbcBJHAe (ORCPT + 11 others); Wed, 10 Feb 2016 02:00:34 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36313 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbcBJHAc (ORCPT ); Wed, 10 Feb 2016 02:00:32 -0500 Received: by mail-pa0-f53.google.com with SMTP id yy13so7266024pab.3 for ; Tue, 09 Feb 2016 23:00:31 -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=3RRMOGrAUSfa4LkeZvrrprFiWHHrjjl556C8Zwnv/ws=; b=TEzaO7fLy7vQkUsnFO2CMkw4vVYi/gYEHz90FHdA2fRPsP5NT8cuMPwxKxDtGnbso7 3baTlhwwgo+uul3M55smhgPl1hjV4bTq7OYQ03/qyVAmUyU9usWvrrohG+coHYk2Aq/Q Fj4Igc8I4T9hPMsg47Db6rZURi45hcJ05v+o0= 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=3RRMOGrAUSfa4LkeZvrrprFiWHHrjjl556C8Zwnv/ws=; b=Y2KxHRi/VQQAqnjcKHIRsZXV7tp1opOmmIqQYix3D3AFp9VC0k5jtMQCbNB7L+8+vO A60idNQkRK7QL05M0QQqM5D+GtFOl586/Z1GHjANCJxgUG02HBwnmYjQptRcbOhmLPcJ E08ZPsxR1KXfF9aI3j9yvnsUqsZokBovD0a94ut+vr/idIlCueiXpPzshpY+sOfGo5ib y9dTlwXL+OekZbNAavC00IVvcR/8H144HtURhhx6AT+uOJzKKfMvmTxKzhlMXAYqWCpG R0AeegAbvySGt3x9UB0SpYbUhcrmERgRb8dc04M8hq4uUm5LClGA/2bS4WjLnu7zVEpM 7PJA== X-Gm-Message-State: AG10YORt+ZZD3N+vmVaPRy6rdNZTtLM571iwc5WC+0sR7Z+FJ2da+Dyg37khrnRmoIbfFZ/M X-Received: by 10.66.187.77 with SMTP id fq13mr38650874pac.25.1455087631763; Tue, 09 Feb 2016 23:00:31 -0800 (PST) Received: from localhost ([122.172.22.246]) by smtp.gmail.com with ESMTPSA id z3sm2406681par.17.2016.02.09.23.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2016 23:00:31 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH V5 3/3] cpufreq: ondemand: Rearrange od_dbs_timer() to avoid updating delay Date: Wed, 10 Feb 2016 12:30:13 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.370.gb2aa7f8 In-Reply-To: <8ddf5eb44eebba01062234d9aed931e3b6882a2b.1455087379.git.viresh.kumar@linaro.org> References: <8ddf5eb44eebba01062234d9aed931e3b6882a2b.1455087379.git.viresh.kumar@linaro.org> In-Reply-To: <8ddf5eb44eebba01062234d9aed931e3b6882a2b.1455087379.git.viresh.kumar@linaro.org> References: <8ddf5eb44eebba01062234d9aed931e3b6882a2b.1455087379.git.viresh.kumar@linaro.org> 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 12213823cc93..0b79f1488be4 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; }