linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64
@ 2012-10-24  7:45 Viresh Kumar
  2012-10-24  7:45 ` [PATCH 2/2] cpufreq: Fix sparse warning by making local function static Viresh Kumar
  2012-10-24 21:14 ` [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Viresh Kumar @ 2012-10-24  7:45 UTC (permalink / raw)
  To: rjw
  Cc: cpufreq, linux-pm, linaro-dev, patches, pdsw-power-team,
	arvind.chauhan, fengguang.wu, Viresh Kumar

There were few sparse warnings due to mismatch of type on function arguments.
Two types were used u64 and cputime64_t. Both are actually u64, so use u64 only.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---

This solution was discussed here:

http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg13744.html

 drivers/cpufreq/cpufreq_governor.c |  4 ++--
 drivers/cpufreq/cpufreq_governor.h | 11 +++++------
 drivers/cpufreq/cpufreq_stats.c    |  4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index cd5fe57..e39bf81 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -49,7 +49,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
 	return jiffies_to_usecs(idle_time);
 }
 
-cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
+u64 get_cpu_idle_time(unsigned int cpu, u64 *wall)
 {
 	u64 idle_time = get_cpu_idle_time_us(cpu, NULL);
 
@@ -81,7 +81,7 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
 	/* Get Absolute Load (in terms of freq for ondemand gov) */
 	for_each_cpu(j, policy->cpus) {
 		struct cpu_dbs_common_info *j_cdbs;
-		cputime64_t cur_wall_time, cur_idle_time, cur_iowait_time;
+		u64 cur_wall_time, cur_idle_time, cur_iowait_time;
 		unsigned int idle_time, wall_time, iowait_time;
 		unsigned int load;
 
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index 34e14ad..f661654 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -17,7 +17,6 @@
 #ifndef _CPUFREQ_GOVERNER_H
 #define _CPUFREQ_GOVERNER_H
 
-#include <asm/cputime.h>
 #include <linux/cpufreq.h>
 #include <linux/kobject.h>
 #include <linux/mutex.h>
@@ -72,9 +71,9 @@ static void *get_cpu_dbs_info_s(int cpu)				\
 /* Per cpu structures */
 struct cpu_dbs_common_info {
 	int cpu;
-	cputime64_t prev_cpu_idle;
-	cputime64_t prev_cpu_wall;
-	cputime64_t prev_cpu_nice;
+	u64 prev_cpu_idle;
+	u64 prev_cpu_wall;
+	u64 prev_cpu_nice;
 	struct cpufreq_policy *cur_policy;
 	struct delayed_work work;
 	/*
@@ -87,7 +86,7 @@ struct cpu_dbs_common_info {
 
 struct od_cpu_dbs_info_s {
 	struct cpu_dbs_common_info cdbs;
-	cputime64_t prev_cpu_iowait;
+	u64 prev_cpu_iowait;
 	struct cpufreq_frequency_table *freq_table;
 	unsigned int freq_lo;
 	unsigned int freq_lo_jiffies;
@@ -170,7 +169,7 @@ static inline int delay_for_sampling_rate(unsigned int sampling_rate)
 	return delay;
 }
 
-cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall);
+u64 get_cpu_idle_time(unsigned int cpu, u64 *wall);
 void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
 int cpufreq_governor_dbs(struct dbs_data *dbs_data,
 		struct cpufreq_policy *policy, unsigned int event);
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index b40ee14..683a48f 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -37,7 +37,7 @@ struct cpufreq_stats {
 	unsigned int max_state;
 	unsigned int state_num;
 	unsigned int last_index;
-	cputime64_t *time_in_state;
+	u64 *time_in_state;
 	unsigned int *freq_table;
 #ifdef CONFIG_CPU_FREQ_STAT_DETAILS
 	unsigned int *trans_table;
@@ -223,7 +223,7 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
 		count++;
 	}
 
-	alloc_size = count * sizeof(int) + count * sizeof(cputime64_t);
+	alloc_size = count * sizeof(int) + count * sizeof(u64);
 
 #ifdef CONFIG_CPU_FREQ_STAT_DETAILS
 	alloc_size += count * count * sizeof(int);
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH 2/2] cpufreq: Fix sparse warning by making local function static
  2012-10-24  7:45 [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Viresh Kumar
@ 2012-10-24  7:45 ` Viresh Kumar
  2012-10-24 21:14 ` [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Rafael J. Wysocki
  1 sibling, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2012-10-24  7:45 UTC (permalink / raw)
  To: rjw
  Cc: cpufreq, linux-pm, linaro-dev, patches, pdsw-power-team,
	arvind.chauhan, fengguang.wu, Viresh Kumar

cpufreq_disabled() is a local function, so should be marked static.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f552d5f..261ef65 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -129,7 +129,7 @@ static int __init init_cpufreq_transition_notifier_list(void)
 pure_initcall(init_cpufreq_transition_notifier_list);
 
 static int off __read_mostly;
-int cpufreq_disabled(void)
+static int cpufreq_disabled(void)
 {
 	return off;
 }
-- 
1.7.12.rc2.18.g61b472e


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

* Re: [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64
  2012-10-24  7:45 [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Viresh Kumar
  2012-10-24  7:45 ` [PATCH 2/2] cpufreq: Fix sparse warning by making local function static Viresh Kumar
@ 2012-10-24 21:14 ` Rafael J. Wysocki
  2012-10-25  3:30   ` Viresh Kumar
  1 sibling, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-10-24 21:14 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: cpufreq, linux-pm, linaro-dev, patches, pdsw-power-team,
	arvind.chauhan, fengguang.wu

On Wednesday 24 of October 2012 13:15:58 Viresh Kumar wrote:
> There were few sparse warnings due to mismatch of type on function arguments.
> Two types were used u64 and cputime64_t. Both are actually u64, so use u64 only.
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

This series appears to be based on your "cpufreq: governors: remove
redundant code" patch that hasn't been applied yet.

Please rebase it on top of linux-pm/linux-next or on top of v3.7-rc2,
whichever is more convenient, and resend.

Thanks,
Rafael


> ---
> 
> This solution was discussed here:
> 
> http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg13744.html
> 
>  drivers/cpufreq/cpufreq_governor.c |  4 ++--
>  drivers/cpufreq/cpufreq_governor.h | 11 +++++------
>  drivers/cpufreq/cpufreq_stats.c    |  4 ++--
>  3 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> index cd5fe57..e39bf81 100644
> --- a/drivers/cpufreq/cpufreq_governor.c
> +++ b/drivers/cpufreq/cpufreq_governor.c
> @@ -49,7 +49,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
>  	return jiffies_to_usecs(idle_time);
>  }
>  
> -cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
> +u64 get_cpu_idle_time(unsigned int cpu, u64 *wall)
>  {
>  	u64 idle_time = get_cpu_idle_time_us(cpu, NULL);
>  
> @@ -81,7 +81,7 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
>  	/* Get Absolute Load (in terms of freq for ondemand gov) */
>  	for_each_cpu(j, policy->cpus) {
>  		struct cpu_dbs_common_info *j_cdbs;
> -		cputime64_t cur_wall_time, cur_idle_time, cur_iowait_time;
> +		u64 cur_wall_time, cur_idle_time, cur_iowait_time;
>  		unsigned int idle_time, wall_time, iowait_time;
>  		unsigned int load;
>  
> diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
> index 34e14ad..f661654 100644
> --- a/drivers/cpufreq/cpufreq_governor.h
> +++ b/drivers/cpufreq/cpufreq_governor.h
> @@ -17,7 +17,6 @@
>  #ifndef _CPUFREQ_GOVERNER_H
>  #define _CPUFREQ_GOVERNER_H
>  
> -#include <asm/cputime.h>
>  #include <linux/cpufreq.h>
>  #include <linux/kobject.h>
>  #include <linux/mutex.h>
> @@ -72,9 +71,9 @@ static void *get_cpu_dbs_info_s(int cpu)				\
>  /* Per cpu structures */
>  struct cpu_dbs_common_info {
>  	int cpu;
> -	cputime64_t prev_cpu_idle;
> -	cputime64_t prev_cpu_wall;
> -	cputime64_t prev_cpu_nice;
> +	u64 prev_cpu_idle;
> +	u64 prev_cpu_wall;
> +	u64 prev_cpu_nice;
>  	struct cpufreq_policy *cur_policy;
>  	struct delayed_work work;
>  	/*
> @@ -87,7 +86,7 @@ struct cpu_dbs_common_info {
>  
>  struct od_cpu_dbs_info_s {
>  	struct cpu_dbs_common_info cdbs;
> -	cputime64_t prev_cpu_iowait;
> +	u64 prev_cpu_iowait;
>  	struct cpufreq_frequency_table *freq_table;
>  	unsigned int freq_lo;
>  	unsigned int freq_lo_jiffies;
> @@ -170,7 +169,7 @@ static inline int delay_for_sampling_rate(unsigned int sampling_rate)
>  	return delay;
>  }
>  
> -cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall);
> +u64 get_cpu_idle_time(unsigned int cpu, u64 *wall);
>  void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
>  int cpufreq_governor_dbs(struct dbs_data *dbs_data,
>  		struct cpufreq_policy *policy, unsigned int event);
> diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
> index b40ee14..683a48f 100644
> --- a/drivers/cpufreq/cpufreq_stats.c
> +++ b/drivers/cpufreq/cpufreq_stats.c
> @@ -37,7 +37,7 @@ struct cpufreq_stats {
>  	unsigned int max_state;
>  	unsigned int state_num;
>  	unsigned int last_index;
> -	cputime64_t *time_in_state;
> +	u64 *time_in_state;
>  	unsigned int *freq_table;
>  #ifdef CONFIG_CPU_FREQ_STAT_DETAILS
>  	unsigned int *trans_table;
> @@ -223,7 +223,7 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
>  		count++;
>  	}
>  
> -	alloc_size = count * sizeof(int) + count * sizeof(cputime64_t);
> +	alloc_size = count * sizeof(int) + count * sizeof(u64);
>  
>  #ifdef CONFIG_CPU_FREQ_STAT_DETAILS
>  	alloc_size += count * count * sizeof(int);
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64
  2012-10-24 21:14 ` [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Rafael J. Wysocki
@ 2012-10-25  3:30   ` Viresh Kumar
       [not found]     ` <CAKohpo=Sw6eUP6Xk3=a=rk6WMJQta=T7ReBPM+7e9E5PsvMJgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2012-10-25  3:30 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: cpufreq, linux-pm, linaro-dev, patches, pdsw-power-team,
	arvind.chauhan, fengguang.wu

On 25 October 2012 02:44, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Wednesday 24 of October 2012 13:15:58 Viresh Kumar wrote:
>> There were few sparse warnings due to mismatch of type on function arguments.
>> Two types were used u64 and cputime64_t. Both are actually u64, so use u64 only.
>>
>> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> This series appears to be based on your "cpufreq: governors: remove
> redundant code" patch that hasn't been applied yet.
>
> Please rebase it on top of linux-pm/linux-next or on top of v3.7-rc2,
> whichever is more convenient, and resend.

Please apply it after applying the latest cpufreq: governors patch i have sent.

--
viresh

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

* Re: [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64
       [not found]     ` <CAKohpo=Sw6eUP6Xk3=a=rk6WMJQta=T7ReBPM+7e9E5PsvMJgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-10-26  0:10       ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-10-26  0:10 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: fengguang.wu-ral2JQCrhuEAvxtiuMwx3w,
	linaro-dev-cunTk1MwBs8s++Sfvej+rw, patches-QSEj5FYQhm4dnm+yROfE0A,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, cpufreq-u79uwXL29TY76Z2rM5mHXA,
	pdsw-power-team-5wv7dgnIgG8

On Thursday, October 25, 2012 09:00:22 AM Viresh Kumar wrote:
> On 25 October 2012 02:44, Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org> wrote:
> > On Wednesday 24 of October 2012 13:15:58 Viresh Kumar wrote:
> >> There were few sparse warnings due to mismatch of type on function arguments.
> >> Two types were used u64 and cputime64_t. Both are actually u64, so use u64 only.
> >>
> >> Reported-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> >> Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> >
> > This series appears to be based on your "cpufreq: governors: remove
> > redundant code" patch that hasn't been applied yet.
> >
> > Please rebase it on top of linux-pm/linux-next or on top of v3.7-rc2,
> > whichever is more convenient, and resend.
> 
> Please apply it after applying the latest cpufreq: governors patch i have sent.

Done.

Thanks,
Rafael


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

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

end of thread, other threads:[~2012-10-26  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24  7:45 [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Viresh Kumar
2012-10-24  7:45 ` [PATCH 2/2] cpufreq: Fix sparse warning by making local function static Viresh Kumar
2012-10-24 21:14 ` [PATCH 1/2] cpufreq: Fix sparse warnings by updating cputime64_t to u64 Rafael J. Wysocki
2012-10-25  3:30   ` Viresh Kumar
     [not found]     ` <CAKohpo=Sw6eUP6Xk3=a=rk6WMJQta=T7ReBPM+7e9E5PsvMJgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-26  0:10       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).