* drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast
@ 2012-10-23 3:37 Fengguang Wu
2012-10-23 11:23 ` Song, Youquan
0 siblings, 1 reply; 3+ messages in thread
From: Fengguang Wu @ 2012-10-23 3:37 UTC (permalink / raw)
To: Youquan Song; +Cc: linux-pm, Rik van Riel, Rafael J. Wysocki
Hi Youquan,
FYI, there are new compile warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
head: 13f5e2d9a915373dd1573d8fe0214738bc69004f
commit: 0c963c99eb65aa9991cec6b3ea3188862167c427 cpuidle: Get typical recent sleep interval
date: 4 hours ago
config: sh-sh7785lcr_32bit_defconfig # make ARCH=sh sh7785lcr_32bit_defconfig
All warnings:
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]
vim +268 drivers/cpuidle/governors/menu.c
0c963c99 Youquan Song 2012-10-23 252 int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
0c963c99 Youquan Song 2012-10-23 253 unsigned int ret = 0;
1f85f87d Arjan van de Ven 2010-05-24 254
0c963c99 Youquan Song 2012-10-23 255 again:
1f85f87d Arjan van de Ven 2010-05-24 256
0c963c99 Youquan Song 2012-10-23 257 /* first calculate average and standard deviation of the past */
0c963c99 Youquan Song 2012-10-23 258 max = avg = divisor = stddev = 0;
0c963c99 Youquan Song 2012-10-23 259 for (i = 0; i < INTERVALS; i++) {
0c963c99 Youquan Song 2012-10-23 260 int64_t value = data->intervals[i];
0c963c99 Youquan Song 2012-10-23 261 if (value <= thresh) {
0c963c99 Youquan Song 2012-10-23 262 avg += value;
0c963c99 Youquan Song 2012-10-23 263 divisor++;
0c963c99 Youquan Song 2012-10-23 264 if (value > max)
0c963c99 Youquan Song 2012-10-23 265 max = value;
0c963c99 Youquan Song 2012-10-23 266 }
0c963c99 Youquan Song 2012-10-23 267 }
0c963c99 Youquan Song 2012-10-23 @268 do_div(avg, divisor);
0c963c99 Youquan Song 2012-10-23 269
0c963c99 Youquan Song 2012-10-23 270 for (i = 0; i < INTERVALS; i++) {
0c963c99 Youquan Song 2012-10-23 271 int64_t value = data->intervals[i];
0c963c99 Youquan Song 2012-10-23 272 if (value <= thresh) {
0c963c99 Youquan Song 2012-10-23 273 int64_t diff = value - avg;
0c963c99 Youquan Song 2012-10-23 274 stddev += diff * diff;
0c963c99 Youquan Song 2012-10-23 275 }
0c963c99 Youquan Song 2012-10-23 276 }
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast
2012-10-23 3:37 drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast Fengguang Wu
@ 2012-10-23 11:23 ` Song, Youquan
2012-10-23 12:44 ` Fengguang Wu
0 siblings, 1 reply; 3+ messages in thread
From: Song, Youquan @ 2012-10-23 11:23 UTC (permalink / raw)
To: Wu, Fengguang
Cc: linux-pm@vger.kernel.org, Rik van Riel, Wysocki, Rafael J,
Song, Youquan
Hi Fengguang,
Sorry. I built the kernel at 32bit OS RHEL6 i686 without any complain about it.
Are you built it for sh architecture? by "make ARCH=sh sh7785lcr_32bit_defconfig", I do not know this architecture at all. Who can help me on it?
Thanks
-Youquan
-----Original Message-----
From: Wu, Fengguang
Sent: Tuesday, October 23, 2012 11:37 AM
To: Song, Youquan
Cc: linux-pm@vger.kernel.org; Rik van Riel; Wysocki, Rafael J
Subject: drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast
Hi Youquan,
FYI, there are new compile warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
head: 13f5e2d9a915373dd1573d8fe0214738bc69004f
commit: 0c963c99eb65aa9991cec6b3ea3188862167c427 cpuidle: Get typical recent sleep interval
date: 4 hours ago
config: sh-sh7785lcr_32bit_defconfig # make ARCH=sh sh7785lcr_32bit_defconfig
All warnings:
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]
vim +268 drivers/cpuidle/governors/menu.c
0c963c99 Youquan Song 2012-10-23 252 int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
0c963c99 Youquan Song 2012-10-23 253 unsigned int ret = 0;
1f85f87d Arjan van de Ven 2010-05-24 254
0c963c99 Youquan Song 2012-10-23 255 again:
1f85f87d Arjan van de Ven 2010-05-24 256
0c963c99 Youquan Song 2012-10-23 257 /* first calculate average and standard deviation of the past */
0c963c99 Youquan Song 2012-10-23 258 max = avg = divisor = stddev = 0;
0c963c99 Youquan Song 2012-10-23 259 for (i = 0; i < INTERVALS; i++) {
0c963c99 Youquan Song 2012-10-23 260 int64_t value = data->intervals[i];
0c963c99 Youquan Song 2012-10-23 261 if (value <= thresh) {
0c963c99 Youquan Song 2012-10-23 262 avg += value;
0c963c99 Youquan Song 2012-10-23 263 divisor++;
0c963c99 Youquan Song 2012-10-23 264 if (value > max)
0c963c99 Youquan Song 2012-10-23 265 max = value;
0c963c99 Youquan Song 2012-10-23 266 }
0c963c99 Youquan Song 2012-10-23 267 }
0c963c99 Youquan Song 2012-10-23 @268 do_div(avg, divisor);
0c963c99 Youquan Song 2012-10-23 269
0c963c99 Youquan Song 2012-10-23 270 for (i = 0; i < INTERVALS; i++) {
0c963c99 Youquan Song 2012-10-23 271 int64_t value = data->intervals[i];
0c963c99 Youquan Song 2012-10-23 272 if (value <= thresh) {
0c963c99 Youquan Song 2012-10-23 273 int64_t diff = value - avg;
0c963c99 Youquan Song 2012-10-23 274 stddev += diff * diff;
0c963c99 Youquan Song 2012-10-23 275 }
0c963c99 Youquan Song 2012-10-23 276 }
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast
2012-10-23 11:23 ` Song, Youquan
@ 2012-10-23 12:44 ` Fengguang Wu
0 siblings, 0 replies; 3+ messages in thread
From: Fengguang Wu @ 2012-10-23 12:44 UTC (permalink / raw)
To: Song, Youquan; +Cc: linux-pm@vger.kernel.org, Rik van Riel, Wysocki, Rafael J
Youquan,
On Tue, Oct 23, 2012 at 07:23:00PM +0800, Song, Youquan wrote:
> Hi Fengguang,
>
> Sorry. I built the kernel at 32bit OS RHEL6 i686 without any complain about it.
> Are you built it for sh architecture? by "make ARCH=sh sh7785lcr_32bit_defconfig", I do not know this architecture at all. Who can help me on it?
No worry. This is tested to remove the following warnings.
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]
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-23 12:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-23 3:37 drivers/cpuidle/governors/menu.c:268:2: warning: comparison of distinct pointer types lacks a cast Fengguang Wu
2012-10-23 11:23 ` Song, Youquan
2012-10-23 12:44 ` Fengguang Wu
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).