public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] cpuidle: fix warning when compile
  2012-10-24  2:45 [PATCH] cpuidle: fix warning when compile Youquan Song
@ 2012-10-23 14:42 ` Fengguang Wu
  2012-10-24  0:28 ` Rafael J. Wysocki
  1 sibling, 0 replies; 5+ messages in thread
From: Fengguang Wu @ 2012-10-23 14:42 UTC (permalink / raw)
  To: Youquan Song; +Cc: yuanhan.liu, rjw, Rik van Riel, linux-pm, Youquan Song

On Tue, Oct 23, 2012 at 10:45:28PM -0400, Youquan Song wrote:
> Fix the warning complain when compile the kernel.
> 
> drivers/cpuidle/governors/menu.c: In function 'get_typical_interval':
> drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> drivers/cpuidle/governors/menu.c:277:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> 
> Signed-off-by: Youquan Song <youquan.song@intel.com>

Tested-by: Fengguang Wu <wfg@linux.intel.com>

> ---
>  drivers/cpuidle/governors/menu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 26d5667..2efee27 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -248,7 +248,7 @@ static enum hrtimer_restart menu_hrtimer_notify(struct hrtimer *hrtimer)
>  static u32 get_typical_interval(struct menu_device *data)
>  {
>  	int i = 0, divisor = 0;
> -	int64_t max = 0, avg = 0, stddev = 0;
> +	uint64_t max = 0, avg = 0, stddev = 0;
>  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
>  	unsigned int ret = 0;
>  
> -- 
> 1.7.7.4

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

* Re: [PATCH] cpuidle: fix warning when compile
  2012-10-24  2:45 [PATCH] cpuidle: fix warning when compile Youquan Song
  2012-10-23 14:42 ` Fengguang Wu
@ 2012-10-24  0:28 ` Rafael J. Wysocki
  2012-10-24  2:14   ` Song, Youquan
  1 sibling, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-10-24  0:28 UTC (permalink / raw)
  To: Youquan Song
  Cc: fengguang.wu, yuanhan.liu, Rik van Riel, linux-pm, Youquan Song

On Tuesday 23 of October 2012 22:45:28 Youquan Song wrote:
> Fix the warning complain when compile the kernel.
> 
> drivers/cpuidle/governors/menu.c: In function 'get_typical_interval':
> drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> drivers/cpuidle/governors/menu.c:277:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> 
> Signed-off-by: Youquan Song <youquan.song@intel.com>
> ---
>  drivers/cpuidle/governors/menu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 26d5667..2efee27 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -248,7 +248,7 @@ static enum hrtimer_restart menu_hrtimer_notify(struct hrtimer *hrtimer)
>  static u32 get_typical_interval(struct menu_device *data)
>  {
>  	int i = 0, divisor = 0;
> -	int64_t max = 0, avg = 0, stddev = 0;
> +	uint64_t max = 0, avg = 0, stddev = 0;
>  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */

Shouldn't this one be uint64_t too?

>  	unsigned int ret = 0;

Rafael


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

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

* RE: [PATCH] cpuidle: fix warning when compile
  2012-10-24  0:28 ` Rafael J. Wysocki
@ 2012-10-24  2:14   ` Song, Youquan
  2012-10-24 21:03     ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Song, Youquan @ 2012-10-24  2:14 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Wu, Fengguang, yuanhan.liu@linux.intel.com, Rik van Riel,
	linux-pm@vger.kernel.org, Youquan Song, Song, Youquan

>>  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */

>Shouldn't this one be uint64_t too?

Thanks Rafael!  Fenggung also asked me the similar question. 
But I think, the compile only complains about do_div() at SH 32bit architecture, the above int64_t definition should be OK and I do not find any issue without changing it to uint64_t. 

Thanks
-Youquan

-----Original Message-----
From: Rafael J. Wysocki [mailto:rjw@sisk.pl] 
Sent: Wednesday, October 24, 2012 8:28 AM
To: Song, Youquan
Cc: Wu, Fengguang; yuanhan.liu@linux.intel.com; Rik van Riel; linux-pm@vger.kernel.org; Youquan Song
Subject: Re: [PATCH] cpuidle: fix warning when compile

On Tuesday 23 of October 2012 22:45:28 Youquan Song wrote:
> Fix the warning complain when compile the kernel.
> 
> drivers/cpuidle/governors/menu.c: In function 'get_typical_interval':
> drivers/cpuidle/governors/menu.c:268:2: warning: comparison of 
> distinct pointer types lacks a cast [enabled by default]
> drivers/cpuidle/governors/menu.c:277:2: warning: comparison of 
> distinct pointer types lacks a cast [enabled by default]
> 
> Signed-off-by: Youquan Song <youquan.song@intel.com>
> ---
>  drivers/cpuidle/governors/menu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/cpuidle/governors/menu.c 
> b/drivers/cpuidle/governors/menu.c
> index 26d5667..2efee27 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -248,7 +248,7 @@ static enum hrtimer_restart 
> menu_hrtimer_notify(struct hrtimer *hrtimer)  static u32 
> get_typical_interval(struct menu_device *data)  {
>  	int i = 0, divisor = 0;
> -	int64_t max = 0, avg = 0, stddev = 0;
> +	uint64_t max = 0, avg = 0, stddev = 0;
>  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */

Shouldn't this one be uint64_t too?

>  	unsigned int ret = 0;

Rafael


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

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

* [PATCH] cpuidle: fix warning when compile
@ 2012-10-24  2:45 Youquan Song
  2012-10-23 14:42 ` Fengguang Wu
  2012-10-24  0:28 ` Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Youquan Song @ 2012-10-24  2:45 UTC (permalink / raw)
  To: fengguang.wu, yuanhan.liu, rjw, Rik van Riel, linux-pm
  Cc: Youquan Song, Youquan Song

Fix the warning complain when compile the kernel.

drivers/cpuidle/governors/menu.c: In function 'get_typical_interval':
drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]
drivers/cpuidle/governors/menu.c:277:2: warning: comparison of distinct pointer types lacks a cast [enabled by default]

Signed-off-by: Youquan Song <youquan.song@intel.com>
---
 drivers/cpuidle/governors/menu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 26d5667..2efee27 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -248,7 +248,7 @@ static enum hrtimer_restart menu_hrtimer_notify(struct hrtimer *hrtimer)
 static u32 get_typical_interval(struct menu_device *data)
 {
 	int i = 0, divisor = 0;
-	int64_t max = 0, avg = 0, stddev = 0;
+	uint64_t max = 0, avg = 0, stddev = 0;
 	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
 	unsigned int ret = 0;
 
-- 
1.7.7.4


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

* Re: [PATCH] cpuidle: fix warning when compile
  2012-10-24  2:14   ` Song, Youquan
@ 2012-10-24 21:03     ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-10-24 21:03 UTC (permalink / raw)
  To: Song, Youquan
  Cc: Wu, Fengguang, yuanhan.liu@linux.intel.com, Rik van Riel,
	linux-pm@vger.kernel.org, Youquan Song

On Wednesday 24 of October 2012 02:14:13 Song, Youquan wrote:
> >>  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
> 
> >Shouldn't this one be uint64_t too?
> 
> Thanks Rafael!  Fenggung also asked me the similar question. 
> But I think, the compile only complains about do_div() at SH 32bit
> architecture, the above int64_t definition should be OK and I do not
> find any issue without changing it to uint64_t. 

OK

I fixed up the original patch.

Thanks,
Rafael


> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@sisk.pl] 
> Sent: Wednesday, October 24, 2012 8:28 AM
> To: Song, Youquan
> Cc: Wu, Fengguang; yuanhan.liu@linux.intel.com; Rik van Riel; linux-pm@vger.kernel.org; Youquan Song
> Subject: Re: [PATCH] cpuidle: fix warning when compile
> 
> On Tuesday 23 of October 2012 22:45:28 Youquan Song wrote:
> > Fix the warning complain when compile the kernel.
> > 
> > drivers/cpuidle/governors/menu.c: In function 'get_typical_interval':
> > drivers/cpuidle/governors/menu.c:268:2: warning: comparison of 
> > distinct pointer types lacks a cast [enabled by default]
> > drivers/cpuidle/governors/menu.c:277:2: warning: comparison of 
> > distinct pointer types lacks a cast [enabled by default]
> > 
> > Signed-off-by: Youquan Song <youquan.song@intel.com>
> > ---
> >  drivers/cpuidle/governors/menu.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/cpuidle/governors/menu.c 
> > b/drivers/cpuidle/governors/menu.c
> > index 26d5667..2efee27 100644
> > --- a/drivers/cpuidle/governors/menu.c
> > +++ b/drivers/cpuidle/governors/menu.c
> > @@ -248,7 +248,7 @@ static enum hrtimer_restart 
> > menu_hrtimer_notify(struct hrtimer *hrtimer)  static u32 
> > get_typical_interval(struct menu_device *data)  {
> >  	int i = 0, divisor = 0;
> > -	int64_t max = 0, avg = 0, stddev = 0;
> > +	uint64_t max = 0, avg = 0, stddev = 0;
> >  	int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
> 
> Shouldn't this one be uint64_t too?
> 
> >  	unsigned int ret = 0;

-- 
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-24 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24  2:45 [PATCH] cpuidle: fix warning when compile Youquan Song
2012-10-23 14:42 ` Fengguang Wu
2012-10-24  0:28 ` Rafael J. Wysocki
2012-10-24  2:14   ` Song, Youquan
2012-10-24 21:03     ` 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