From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400Ab3HFNw0 (ORCPT ); Tue, 6 Aug 2013 09:52:26 -0400 Received: from hydra.sisk.pl ([212.160.235.94]:57974 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022Ab3HFNwZ (ORCPT ); Tue, 6 Aug 2013 09:52:25 -0400 From: "Rafael J. Wysocki" To: Viresh Kumar 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 Subject: Re: [PATCH 03/10] cpufreq: Give consistent names for struct cpufreq_policy * Date: Tue, 06 Aug 2013 16:02:37 +0200 Message-ID: <2873799.lFo4PWMlur@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.11.0-rc4+; KDE/4.9.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, August 06, 2013 07:08:24 PM Viresh Kumar wrote: > On 3 August 2013 17:19, Viresh Kumar wrote: > > They are named as policy, cur_policy, new_policy, data, etc.. Just name them > > poicy wherever possible. > > > > Signed-off-by: Viresh Kumar > > --- > > drivers/cpufreq/cpufreq.c | 200 ++++++++++++++++++------------------- > > drivers/cpufreq/cpufreq_governor.h | 2 +- > > drivers/cpufreq/cpufreq_ondemand.c | 10 +- > > drivers/cpufreq/cpufreq_stats.c | 14 +-- > > include/linux/cpufreq.h | 2 +- > > 5 files changed, 111 insertions(+), 117 deletions(-) > > Another Fixup :) > > @Rafael: Apart from that I found things to be pretty stable now and > so I can go ahead with the V2 of this patchset.. And then maybe we > can get in linux-next so it receives some testing before 3.12. Yes, please submit. Thanks, Rafael > diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c > index 1e630d0..7461a88 100644 > --- a/drivers/cpufreq/cpufreq_stats.c > +++ b/drivers/cpufreq/cpufreq_stats.c > @@ -194,7 +194,7 @@ static int cpufreq_stats_create_table(struct > cpufreq_policy *policy, > { > unsigned int i, j, count = 0, ret = 0; > struct cpufreq_stats *stat; > - struct cpufreq_policy *data; > + struct cpufreq_policy *current_policy; > unsigned int alloc_size; > unsigned int cpu = policy->cpu; > if (per_cpu(cpufreq_stats_table, cpu)) > @@ -203,13 +203,13 @@ static int cpufreq_stats_create_table(struct > cpufreq_policy *policy, > if ((stat) == NULL) > return -ENOMEM; > > - data = cpufreq_cpu_get(cpu); > - if (data == NULL) { > + current_policy = cpufreq_cpu_get(cpu); > + if (current_policy == NULL) { > ret = -EINVAL; > goto error_get_fail; > } > > - ret = sysfs_create_group(&data->kobj, &stats_attr_group); > + ret = sysfs_create_group(¤t_policy->kobj, &stats_attr_group); > if (ret) > goto error_out; > > @@ -252,10 +252,10 @@ static int cpufreq_stats_create_table(struct > cpufreq_policy *policy, > stat->last_time = get_jiffies_64(); > stat->last_index = freq_table_get_index(stat, policy->cur); > spin_unlock(&cpufreq_stats_lock); > - cpufreq_cpu_put(data); > + cpufreq_cpu_put(current_policy); > return 0; > error_out: > - cpufreq_cpu_put(data); > + cpufreq_cpu_put(current_policy); > error_get_fail: > kfree(stat); > per_cpu(cpufreq_stats_table, cpu) = NULL; -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.