From patchwork Tue Aug 6 17:23:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18810 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E996025DF6 for ; Tue, 6 Aug 2013 17:24:29 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id a11sf749572qen.7 for ; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=5tjAy1TzfSDKQDsH3gQYQ9UAHdA4F4HBba3DizX4RZI=; b=FZkhn+UB5KC4JgvBFEgAN6FjAefBblJjNCOiUqAQDRIasBdKifhEd2td6BCCdjBNXf /1U+zDm+UyX8mwXFK1jSBT4zkiDRuD/fokjGRu9+Ze+olcPb70VByw7977RUFwFyIdFD VKmamY0S02CnBHVe4RXRtJzeleejQGXW+u1Vg4w29RHTq99lbg0Q1TjTGPbjlI7ZUIU/ 6G/fz/d5HUc8dXd9HUWVkglNsoqKuUh+IKFrha4JYC7FVkuUVhf++P4ao+lyz7eSM6f8 Cwzv2PzbSL5KsXRWBixZomAyEWK6AjrBJt0+bVoACVJTcRmkQstcF2AEzBvRpMlQVp3g oXFw== X-Received: by 10.236.206.105 with SMTP id k69mr863247yho.8.1375809869676; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.5.197 with SMTP id u5ls323645qeu.84.gmail; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) X-Received: by 10.58.128.71 with SMTP id nm7mr698784veb.51.1375809869496; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id tt2si543155vcb.2.2013.08.06.10.24.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 10:24:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id i3so691177vbh.40 for ; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) X-Gm-Message-State: ALoCoQmrt7zDuBmw3SUASMFvo+EA4HwdCfrBOE3bNT/JY2WeLX0yniIAwBDWW4SrlAvc6fWxk7Yg X-Received: by 10.52.180.229 with SMTP id dr5mr610508vdc.20.1375809869366; Tue, 06 Aug 2013 10:24:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp157157vcb; Tue, 6 Aug 2013 10:24:28 -0700 (PDT) X-Received: by 10.68.170.37 with SMTP id aj5mr2746896pbc.79.1375809868369; Tue, 06 Aug 2013 10:24:28 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id yk3si3064671pac.302.2013.08.06.10.24.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 10:24:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so1023004pad.32 for ; Tue, 06 Aug 2013 10:24:28 -0700 (PDT) X-Received: by 10.66.176.143 with SMTP id ci15mr4280835pac.146.1375809867895; Tue, 06 Aug 2013 10:24:27 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm3108064pbb.33.2013.08.06.10.24.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 06 Aug 2013 10:24:27 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, srivatsa.bhat@linux.vnet.ibm.com, Viresh Kumar Subject: [PATCH V2 07/11] cpufreq: Use cpufreq_policy_list for iterating over policies Date: Tue, 6 Aug 2013 22:53:09 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , For iterating over all policies currently we are iterating over all CPUs and then finding their policies. Lets use the newly created infrastructure cpufreq_policy_list. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index f5999c4..fe04b79 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -984,8 +984,8 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, struct cpufreq_policy *policy; unsigned long flags; #ifdef CONFIG_HOTPLUG_CPU + struct cpufreq_policy *tpolicy; struct cpufreq_governor *gov; - int sibling; #endif if (cpu_is_offline(cpu)) @@ -1005,11 +1005,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, #ifdef CONFIG_HOTPLUG_CPU /* Check if this cpu was hot-unplugged earlier and has siblings */ read_lock_irqsave(&cpufreq_driver_lock, flags); - for_each_online_cpu(sibling) { - struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling); - if (cp && cpumask_test_cpu(cpu, cp->related_cpus)) { + list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) { + if (cpumask_test_cpu(cpu, tpolicy->related_cpus)) { read_unlock_irqrestore(&cpufreq_driver_lock, flags); - return cpufreq_add_policy_cpu(cp, cpu, dev, frozen); + return cpufreq_add_policy_cpu(tpolicy, cpu, dev, + frozen); } } read_unlock_irqrestore(&cpufreq_driver_lock, flags);