From patchwork Tue Jan 6 15:39:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42782 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCB582055F for ; Tue, 6 Jan 2015 15:40:23 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf13271046lab.4 for ; Tue, 06 Jan 2015 07:40:22 -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=Jwr3w0kiF6J1ib/iAoBWHCepDsWUjQBdWtPQZKo07Ys=; b=efK4uJ+a4d0FAT8TI3wc8uVAzoprLxem3Wsq1vRkvESFBNbP/oaRYFRWsuBMeaOKRv L8E7ufXAaJz9ew7CHoLNRJ4HRqWWUynRM8IdQgYF/Oki7L3ZWYEpqXkWppFN0IuLDn3C KRjCjEhp1aRwUVs6w8g1D3WGpGQXstAfdLmXLTFaAmqOoAPDieBiR3qPBw5Mhvw+LbN1 a9toSJVZtDKHb6hCPQFpvyNNTW6Lretafjt6Aui+sBSNppPZx0dV8zX+nvQEIbfaj2lb nSOBnj+O3LJb8KQp9Cbl5c+eGdp5dvt87z3iNJUv2NIs5rSJm+KoP6PDiiWvBnt3o58y aMNQ== X-Gm-Message-State: ALoCoQmOtJpWGKiuN3pZgTDvAVMrHn/0NsgxVRY4Qr0pbBbWvsA9bGFzjiXMpuwsxHVpcV5hgLle X-Received: by 10.194.71.207 with SMTP id x15mr335694wju.3.1420558822881; Tue, 06 Jan 2015 07:40:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.8 with SMTP id ca8ls54720lad.0.gmail; Tue, 06 Jan 2015 07:40:22 -0800 (PST) X-Received: by 10.152.1.199 with SMTP id 7mr13279082lao.38.1420558822622; Tue, 06 Jan 2015 07:40:22 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id dv9si55713872lbc.63.2015.01.06.07.40.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Jan 2015 07:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so19455369lbi.38 for ; Tue, 06 Jan 2015 07:40:22 -0800 (PST) X-Received: by 10.112.163.33 with SMTP id yf1mr39190431lbb.56.1420558822540; Tue, 06 Jan 2015 07:40:22 -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.9.200 with SMTP id c8csp1209669lbb; Tue, 6 Jan 2015 07:40:21 -0800 (PST) X-Received: by 10.66.171.206 with SMTP id aw14mr156127441pac.40.1420558820746; Tue, 06 Jan 2015 07:40:20 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hz4si17325227pbb.8.2015.01.06.07.40.19; Tue, 06 Jan 2015 07:40:20 -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 S1755489AbbAFPkT (ORCPT + 12 others); Tue, 6 Jan 2015 10:40:19 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:50680 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbbAFPkS (ORCPT ); Tue, 6 Jan 2015 10:40:18 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so31244466pab.2 for ; Tue, 06 Jan 2015 07:40:17 -0800 (PST) X-Received: by 10.68.196.99 with SMTP id il3mr64581730pbc.158.1420558817738; Tue, 06 Jan 2015 07:40:17 -0800 (PST) Received: from localhost ([122.167.212.196]) by mx.google.com with ESMTPSA id do3sm57793712pac.48.2015.01.06.07.40.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 06 Jan 2015 07:40:17 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH V3 13/16] cpufreq: stats: time_in_state can't be NULL in cpufreq_stats_update() Date: Tue, 6 Jan 2015 21:09:12 +0530 Message-Id: <8017f76ae8b40b747ecea193aaaacc70fa6f7257.1420558386.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.2.0 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.179 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: , 'time_in_state' can't be NULL if 'stats' is valid. These are allocated together and only if time_in_state is allocated successfully, we update policy->stats. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_stats.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 17df8c507594..66ebdc4c1762 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -35,9 +35,7 @@ static int cpufreq_stats_update(struct cpufreq_stats *stats) unsigned long long cur_time = get_jiffies_64(); spin_lock(&cpufreq_stats_lock); - if (stats->time_in_state) - stats->time_in_state[stats->last_index] += - cur_time - stats->last_time; + stats->time_in_state[stats->last_index] += cur_time - stats->last_time; stats->last_time = cur_time; spin_unlock(&cpufreq_stats_lock); return 0;