From patchwork Sat Aug 3 11:49:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18752 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 22D1223981 for ; Sat, 3 Aug 2013 11:50:39 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf2079563vbh.1 for ; Sat, 03 Aug 2013 04:50:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state :x-removed-original-auth:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=jsXFoUWs3oqa6gP4nwObD6DRHzOewhyYDv4HAH3fTu8=; b=A6F3eTs47GbTk9n5EEbnFL90CsPmS8cdhR6eotzbt1mJ9JOssiNOyC2n85ZSvht7NZ swWwQTDsxPEPyRIl57Tpo6pxnUdQUc7Qx1uBTXXOXEkLY2zTL0P+rwSHRxZjszPFfaNk 4Zv9BU1kHNey/jAg77mIw4D8jgAcmszWAX7CD8b7tcqCBsmpYpmopw2XGu66vtpDCOPU XHtcBUKc1yQqWhbeiZKYSb5qlAJ5N6GQlqut/kjboAy7XTWM8a89asNDJ/gU9162+Uhd vsRYfnCuxZs2bK/y4uNcELuyikQu5ib9eLISFG6OaF0cPrpsKuLpeqWOAKO1UF7RURv6 JTLA== X-Received: by 10.224.137.137 with SMTP id w9mr15146085qat.6.1375530638887; Sat, 03 Aug 2013 04:50:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls1950514qed.61.gmail; Sat, 03 Aug 2013 04:50:38 -0700 (PDT) X-Received: by 10.58.34.69 with SMTP id x5mr3457826vei.11.1375530638761; Sat, 03 Aug 2013 04:50:38 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id ya5si2980341vec.57.2013.08.03.04.50.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 03 Aug 2013 04:50:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 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.52; Received: by mail-vb0-f52.google.com with SMTP id f12so1516937vbg.39 for ; Sat, 03 Aug 2013 04:50:38 -0700 (PDT) X-Received: by 10.58.128.71 with SMTP id nm7mr3417440veb.51.1375530638650; Sat, 03 Aug 2013 04:50:38 -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 pc8csp469vcb; Sat, 3 Aug 2013 04:50:38 -0700 (PDT) X-Received: by 10.66.227.2 with SMTP id rw2mr15265195pac.131.1375530637711; Sat, 03 Aug 2013 04:50:37 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id dw1si10492725pbc.66.2013.08.03.04.50.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 03 Aug 2013 04:50:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id p11so1557736pdj.4 for ; Sat, 03 Aug 2013 04:50:37 -0700 (PDT) X-Received: by 10.68.235.37 with SMTP id uj5mr1076744pbc.85.1375530637303; Sat, 03 Aug 2013 04:50:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id nv6sm15849273pbc.6.2013.08.03.04.50.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 03 Aug 2013 04:50:36 -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, l.majewski@samsung.com, Viresh Kumar Subject: [PATCH 07/10] cpufreq: Use cpufreq_policy_list for iterating over policies Date: Sat, 3 Aug 2013 17:19:25 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkkHR3p51M98u+0cF2p45m/khS/pfjBtT2jsu/prt94rz+sU73246ovzHnGhsndVeJojCba 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.52 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 4c3aef0..e9b969f 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -983,8 +983,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)) @@ -1004,11 +1004,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);