All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28  1:58 ` Saravana Kannan
  0 siblings, 0 replies; 8+ messages in thread
From: Saravana Kannan @ 2014-02-28  1:58 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: cpufreq, linux-pm, linux-kernel, linux-arm-msm, linux-arm-kernel,
	Saravana Kannan

__cpufreq_stats_create_table always gets pass the valid and real policy
struct. So, there's no need to call cpufreq_cpu_get() to get the policy
again.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
---
 drivers/cpufreq/cpufreq_stats.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 5793e14..e4bd27f 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -185,7 +185,6 @@ 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 *current_policy;
 	unsigned int alloc_size;
 	unsigned int cpu = policy->cpu;
 	if (per_cpu(cpufreq_stats_table, cpu))
@@ -194,13 +193,7 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
 	if ((stat) == NULL)
 		return -ENOMEM;
 
-	current_policy = cpufreq_cpu_get(cpu);
-	if (current_policy == NULL) {
-		ret = -EINVAL;
-		goto error_get_fail;
-	}
-
-	ret = sysfs_create_group(&current_policy->kobj, &stats_attr_group);
+	ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
 	if (ret)
 		goto error_out;
 
@@ -243,11 +236,8 @@ 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(current_policy);
 	return 0;
 error_out:
-	cpufreq_cpu_put(current_policy);
-error_get_fail:
 	kfree(stat);
 	per_cpu(cpufreq_stats_table, cpu) = NULL;
 	return ret;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28  1:58 ` Saravana Kannan
  0 siblings, 0 replies; 8+ messages in thread
From: Saravana Kannan @ 2014-02-28  1:58 UTC (permalink / raw)
  To: linux-arm-kernel

__cpufreq_stats_create_table always gets pass the valid and real policy
struct. So, there's no need to call cpufreq_cpu_get() to get the policy
again.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
---
 drivers/cpufreq/cpufreq_stats.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 5793e14..e4bd27f 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -185,7 +185,6 @@ 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 *current_policy;
 	unsigned int alloc_size;
 	unsigned int cpu = policy->cpu;
 	if (per_cpu(cpufreq_stats_table, cpu))
@@ -194,13 +193,7 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
 	if ((stat) == NULL)
 		return -ENOMEM;
 
-	current_policy = cpufreq_cpu_get(cpu);
-	if (current_policy == NULL) {
-		ret = -EINVAL;
-		goto error_get_fail;
-	}
-
-	ret = sysfs_create_group(&current_policy->kobj, &stats_attr_group);
+	ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
 	if (ret)
 		goto error_out;
 
@@ -243,11 +236,8 @@ 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(current_policy);
 	return 0;
 error_out:
-	cpufreq_cpu_put(current_policy);
-error_get_fail:
 	kfree(stat);
 	per_cpu(cpufreq_stats_table, cpu) = NULL;
 	return ret;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
  2014-02-28  1:58 ` Saravana Kannan
  (?)
@ 2014-02-28  3:48   ` Viresh Kumar
  -1 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2014-02-28  3:48 UTC (permalink / raw)
  To: Saravana Kannan, Srivatsa S. Bhat
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, Linux Kernel Mailing List,
	linux-arm-msm, linux-arm-kernel

On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> __cpufreq_stats_create_table always gets pass the valid and real policy
> struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> again.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> ---
>  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)

All patches look fine now. Rafael you can queue them up as per your
convenience.

@Saravana: Though I am quite sure you still need my patches to get
your initial issue fixed. So, can you please get them tested as early
as possible, so that we can get them in for 3.14?

@Srivatsa: Your reviews will also help :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28  3:48   ` Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2014-02-28  3:48 UTC (permalink / raw)
  To: Saravana Kannan, Srivatsa S. Bhat
  Cc: Rafael J. Wysocki, cpufreq, linux-pm, Linux Kernel Mailing List,
	linux-arm-msm, linux-arm-kernel

On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> __cpufreq_stats_create_table always gets pass the valid and real policy
> struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> again.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> ---
>  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)

All patches look fine now. Rafael you can queue them up as per your
convenience.

@Saravana: Though I am quite sure you still need my patches to get
your initial issue fixed. So, can you please get them tested as early
as possible, so that we can get them in for 3.14?

@Srivatsa: Your reviews will also help :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28  3:48   ` Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2014-02-28  3:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> __cpufreq_stats_create_table always gets pass the valid and real policy
> struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> again.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> ---
>  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)

All patches look fine now. Rafael you can queue them up as per your
convenience.

@Saravana: Though I am quite sure you still need my patches to get
your initial issue fixed. So, can you please get them tested as early
as possible, so that we can get them in for 3.14?

@Srivatsa: Your reviews will also help :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
  2014-02-28  3:48   ` Viresh Kumar
  (?)
@ 2014-02-28 23:26     ` Rafael J. Wysocki
  -1 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-02-28 23:26 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Saravana Kannan, Srivatsa S. Bhat, cpufreq, linux-pm,
	Linux Kernel Mailing List, linux-arm-msm, linux-arm-kernel

On Friday, February 28, 2014 09:18:02 AM Viresh Kumar wrote:
> On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> > __cpufreq_stats_create_table always gets pass the valid and real policy
> > struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> > again.
> >
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> > ---
> >  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> All patches look fine now. Rafael you can queue them up as per your
> convenience.
> 
> @Saravana: Though I am quite sure you still need my patches to get
> your initial issue fixed. So, can you please get them tested as early
> as possible, so that we can get them in for 3.14?

That's a bit late ...

> @Srivatsa: Your reviews will also help :)

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28 23:26     ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-02-28 23:26 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Saravana Kannan, Srivatsa S. Bhat, cpufreq, linux-pm,
	Linux Kernel Mailing List, linux-arm-msm, linux-arm-kernel

On Friday, February 28, 2014 09:18:02 AM Viresh Kumar wrote:
> On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> > __cpufreq_stats_create_table always gets pass the valid and real policy
> > struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> > again.
> >
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> > ---
> >  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> All patches look fine now. Rafael you can queue them up as per your
> convenience.
> 
> @Saravana: Though I am quite sure you still need my patches to get
> your initial issue fixed. So, can you please get them tested as early
> as possible, so that we can get them in for 3.14?

That's a bit late ...

> @Srivatsa: Your reviews will also help :)

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call
@ 2014-02-28 23:26     ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-02-28 23:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday, February 28, 2014 09:18:02 AM Viresh Kumar wrote:
> On 28 February 2014 07:28, Saravana Kannan <skannan@codeaurora.org> wrote:
> > __cpufreq_stats_create_table always gets pass the valid and real policy
> > struct. So, there's no need to call cpufreq_cpu_get() to get the policy
> > again.
> >
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> > ---
> >  drivers/cpufreq/cpufreq_stats.c | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> All patches look fine now. Rafael you can queue them up as per your
> convenience.
> 
> @Saravana: Though I am quite sure you still need my patches to get
> your initial issue fixed. So, can you please get them tested as early
> as possible, so that we can get them in for 3.14?

That's a bit late ...

> @Srivatsa: Your reviews will also help :)

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-28 23:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28  1:58 [PATCH v3 1/3] cpufreq: stats: Remove redundant cpufreq_cpu_get() call Saravana Kannan
2014-02-28  1:58 ` Saravana Kannan
2014-02-28  3:48 ` Viresh Kumar
2014-02-28  3:48   ` Viresh Kumar
2014-02-28  3:48   ` Viresh Kumar
2014-02-28 23:26   ` Rafael J. Wysocki
2014-02-28 23:26     ` Rafael J. Wysocki
2014-02-28 23:26     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.