From patchwork Fri Jan 2 07:04:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42685 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 48C5926CD1 for ; Fri, 2 Jan 2015 07:05:51 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf10394237lab.9 for ; Thu, 01 Jan 2015 23:05:50 -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=s7ZSdITiaU6lkVfIVq9+o+hC50pUBtHdUPCUMngLHLc=; b=P9x5UPDjuOhUCTpEpXTcjIybkNfNAf/arkA3aGDZLBqgLibHoKe0vnJo+kgjXqWRZv OK94xeoVm0xkYJ/kTOBon4i/u50tuyEiQ1Hl3XrrZS54MDzCcPIXAwGuuft9+vMTR+V/ yPWkvKTMcc2fef49R0UorSgIN1oyX12hE4tJVjqvybKgstQxJW/WvWMoQpqKSBfDogoE //HOq/C1PVOxKUQXvK6ueo5IhlVSduJGhLeLKYytVfKg/dGBaUlHNaUTpZLefhx2saAm 1zkFZ1G8NhVbU1AKIB2rokXbHKoCRflbHid0vJ5EfY8q3QHlMnKVxdFpQ9qoOw66qt3/ 2yFQ== X-Gm-Message-State: ALoCoQnpz+xe3SAqUCrGUI0vcsBGcsIwUy67M2xT9NzNJr+fPKtDK6fwNAvs9sH6r7Ykoh/c+P6c X-Received: by 10.112.99.37 with SMTP id en5mr10411lbb.17.1420182350186; Thu, 01 Jan 2015 23:05:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.163 with SMTP id ej3ls2248926lad.94.gmail; Thu, 01 Jan 2015 23:05:50 -0800 (PST) X-Received: by 10.112.166.73 with SMTP id ze9mr13310424lbb.38.1420182349987; Thu, 01 Jan 2015 23:05:49 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id l8si50495125lag.2.2015.01.01.23.05.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so16853862lbj.9 for ; Thu, 01 Jan 2015 23:05:49 -0800 (PST) X-Received: by 10.112.159.136 with SMTP id xc8mr4160375lbb.98.1420182349904; Thu, 01 Jan 2015 23:05:49 -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 c8csp126217lbb; Thu, 1 Jan 2015 23:05:48 -0800 (PST) X-Received: by 10.70.92.3 with SMTP id ci3mr120706393pdb.28.1420182346526; Thu, 01 Jan 2015 23:05:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dl1si29047854pbb.67.2015.01.01.23.05.45; Thu, 01 Jan 2015 23:05: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 S1750764AbbABHFo (ORCPT + 12 others); Fri, 2 Jan 2015 02:05:44 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:63903 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbbABHFo (ORCPT ); Fri, 2 Jan 2015 02:05:44 -0500 Received: by mail-pd0-f169.google.com with SMTP id z10so23380584pdj.28 for ; Thu, 01 Jan 2015 23:05:44 -0800 (PST) X-Received: by 10.70.128.45 with SMTP id nl13mr119337321pdb.126.1420182343987; Thu, 01 Jan 2015 23:05:43 -0800 (PST) Received: from localhost ([122.167.116.151]) by mx.google.com with ESMTPSA id w15sm40821696pbs.59.2015.01.01.23.05.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:43 -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 13/17] cpufreq: limit the scope of l_p_j variables Date: Fri, 2 Jan 2015 12:34:34 +0530 Message-Id: <46d55a2d516c384fee4e0c8e6e60f0add60aa4f8.1420181916.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.178 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: , These variables are just used within adjust_jiffies() and so must be local to it. Also there is no need of a dummy routine for CONFIG_SMP case as we can take care of all that with help of macros in the same routine. It doesn't look that ugly. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 788016cded33..74169ad47546 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -249,12 +249,12 @@ EXPORT_SYMBOL_GPL(cpufreq_cpu_put); * systems as each CPU might be scaled differently. So, use the arch * per-CPU loops_per_jiffy value wherever possible. */ -#ifndef CONFIG_SMP -static unsigned long l_p_j_ref; -static unsigned int l_p_j_ref_freq; - static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) { +#ifndef CONFIG_SMP + static unsigned long l_p_j_ref; + static unsigned int l_p_j_ref_freq; + if (ci->flags & CPUFREQ_CONST_LOOPS) return; @@ -270,13 +270,8 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) pr_debug("scaling loops_per_jiffy to %lu for frequency %u kHz\n", loops_per_jiffy, ci->new); } -} -#else -static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) -{ - return; -} #endif +} static void __cpufreq_notify_transition(struct cpufreq_policy *policy, struct cpufreq_freqs *freqs, unsigned int state)