From patchwork Tue Sep 2 03:41:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 36446 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E9D82032B for ; Tue, 2 Sep 2014 03:41:51 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf36143131oag.7 for ; Mon, 01 Sep 2014 20:41:51 -0700 (PDT) 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=3JAxVvL3n4BPn9Qq33hNilTXUC8f6Rcb8iONgXvRuuI=; b=QYz4d+OJhaDvROkDdCpicnOceUJumGszl/iNUfcXhrZr1iPNXoqLXk9dfRVB4zYUux 2rjgd94gMXklySI++42SzJyh7s42ZqCpS8Uips60GjuBP2srK3zDZCjoDpFrsfroEfgp tIsA9M89wMM1+/0/IymHvHPbXle9ZWqEtSSVNoWOICiiWdExamrM5JmgYETiA8anxEJo kltywxWCZAc3nzsi/quzWKXSLXO7CZ+xXV81ccwuomPS0mcIBflC3Rag4CipxlbGUEpg Ullc7WyLbEveL8RuD+F8c/pktBkwaRVsI0dll8A9bGrMjs13J3twSB6DdJ1l+iDLymYK l20w== X-Gm-Message-State: ALoCoQk65gwXNok9+FDUQwGZ0yZWZpmxyiS4lcf/4gCt+3RBBK9I48ZbfoZdzzBgaaXsCB0bl/sx X-Received: by 10.42.62.73 with SMTP id x9mr11131070ich.15.1409629310799; Mon, 01 Sep 2014 20:41:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.173 with SMTP id 42ls2094509qgj.58.gmail; Mon, 01 Sep 2014 20:41:50 -0700 (PDT) X-Received: by 10.52.30.2 with SMTP id o2mr23340005vdh.12.1409629310713; Mon, 01 Sep 2014 20:41:50 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id rm9si1766918vcb.29.2014.09.01.20.41.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 20:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so6513337vcb.27 for ; Mon, 01 Sep 2014 20:41:50 -0700 (PDT) X-Received: by 10.220.184.70 with SMTP id cj6mr27953918vcb.5.1409629310602; Mon, 01 Sep 2014 20:41:50 -0700 (PDT) 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.221.45.67 with SMTP id uj3csp466230vcb; Mon, 1 Sep 2014 20:41:50 -0700 (PDT) X-Received: by 10.68.131.134 with SMTP id om6mr43110234pbb.41.1409629309732; Mon, 01 Sep 2014 20:41:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hb11si3966030pbd.5.2014.09.01.20.41.48 for ; Mon, 01 Sep 2014 20:41:49 -0700 (PDT) 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 S1752591AbaIBDls (ORCPT + 14 others); Mon, 1 Sep 2014 23:41:48 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:63450 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752453AbaIBDlr (ORCPT ); Mon, 1 Sep 2014 23:41:47 -0400 Received: by mail-pd0-f180.google.com with SMTP id p10so7432496pdj.25 for ; Mon, 01 Sep 2014 20:41:47 -0700 (PDT) X-Received: by 10.70.30.132 with SMTP id s4mr39691787pdh.96.1409629307184; Mon, 01 Sep 2014 20:41:47 -0700 (PDT) Received: from localhost ([122.167.123.172]) by mx.google.com with ESMTPSA id ja3sm2375909pbd.73.2014.09.01.20.41.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 20:41:46 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , yuantian.tang@freescale.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, hongbo.zhang@freescale.com, leoli@freescale.com, Viresh Kumar Subject: [PATCH 2/2] cpufreq: ppc-corenet: remove per-cpu variable 'cpu_mask' Date: Tue, 2 Sep 2014 09:11:25 +0530 Message-Id: <3d467a39ab1b96dc24ed8a71139d5e030239477f.1409629117.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: <09092df3d8b03df99ee475357c5f5c9cc439c61c.1409629117.git.viresh.kumar@linaro.org> References: <09092df3d8b03df99ee475357c5f5c9cc439c61c.1409629117.git.viresh.kumar@linaro.org> In-Reply-To: <09092df3d8b03df99ee475357c5f5c9cc439c61c.1409629117.git.viresh.kumar@linaro.org> References: <09092df3d8b03df99ee475357c5f5c9cc439c61c.1409629117.git.viresh.kumar@linaro.org> 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.220.182 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: , We are copying cpu_core_mask(cpu) in a per-cpu local variable: 'cpu_mask'. There is no need of doing this and can be replaced by a call to cpu_core_mask(). Signed-off-by: Viresh Kumar --- drivers/cpufreq/ppc-corenet-cpufreq.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index bee5df7..dbcac39 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -69,9 +69,6 @@ static const u32 *fmask; static DEFINE_PER_CPU(struct cpu_data *, cpu_data); -/* cpumask in a cluster */ -static DEFINE_PER_CPU(cpumask_var_t, cpu_mask); - #ifndef CONFIG_SMP static inline const struct cpumask *cpu_core_mask(int cpu) { @@ -201,8 +198,8 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy) data->table = table; /* update ->cpus if we have cluster, no harm if not */ - cpumask_copy(policy->cpus, per_cpu(cpu_mask, cpu)); - for_each_cpu(i, per_cpu(cpu_mask, cpu)) + cpumask_copy(policy->cpus, cpu_core_mask(cpu)); + for_each_cpu(i, cpu_core_mask(cpu)) per_cpu(cpu_data, i) = data; /* Minimum transition latency is 12 platform clocks */ @@ -236,7 +233,7 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy) kfree(data->table); kfree(data); - for_each_cpu(cpu, per_cpu(cpu_mask, policy->cpu)) + for_each_cpu(cpu, cpu_core_mask(policy->cpu)) per_cpu(cpu_data, cpu) = NULL; return 0; @@ -285,12 +282,6 @@ static int __init ppc_corenet_cpufreq_init(void) if (!np) return -ENODEV; - for_each_possible_cpu(cpu) { - if (!alloc_cpumask_var(&per_cpu(cpu_mask, cpu), GFP_KERNEL)) - goto err_mask; - cpumask_copy(per_cpu(cpu_mask, cpu), cpu_core_mask(cpu)); - } - match = of_match_node(node_matches, np); data = match->data; if (data) { @@ -308,22 +299,11 @@ static int __init ppc_corenet_cpufreq_init(void) pr_info("Freescale PowerPC corenet CPU frequency scaling driver\n"); return ret; - -err_mask: - for_each_possible_cpu(cpu) - free_cpumask_var(per_cpu(cpu_mask, cpu)); - - return -ENOMEM; } module_init(ppc_corenet_cpufreq_init); static void __exit ppc_corenet_cpufreq_exit(void) { - unsigned int cpu; - - for_each_possible_cpu(cpu) - free_cpumask_var(per_cpu(cpu_mask, cpu)); - cpufreq_unregister_driver(&ppc_corenet_cpufreq_driver); } module_exit(ppc_corenet_cpufreq_exit);