* [PATCH] PM: Fix signed/unsigned warning
@ 2010-09-20 18:33 Kevin Cernekee
2010-09-20 19:27 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cernekee @ 2010-09-20 18:33 UTC (permalink / raw)
To: Pavel Machek, Rafael J. Wysocki; +Cc: linux-pm, linux-kernel
Seen on MIPS32, gcc 4.4.3, 2.6.36-rc4:
drivers/base/power/main.c: In function 'dpm_show_time':
drivers/base/power/main.c:415: warning: comparison of distinct pointer types lacks a cast
do_div() takes unsigned parameters:
uint32_t do_div(uint64_t *n, uint32_t base);
Using an unsigned variable for usecs64 should not cause any problems,
because calltime >= starttime .
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
drivers/base/power/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 276d5a7..db67719 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -407,7 +407,7 @@ static void pm_dev_err(struct device *dev, pm_message_t state, char *info,
static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
{
ktime_t calltime;
- s64 usecs64;
+ u64 usecs64;
int usecs;
calltime = ktime_get();
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] PM: Fix signed/unsigned warning
2010-09-20 18:33 [PATCH] PM: Fix signed/unsigned warning Kevin Cernekee
@ 2010-09-20 19:27 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2010-09-20 19:27 UTC (permalink / raw)
To: Kevin Cernekee; +Cc: Pavel Machek, linux-pm, linux-kernel
On Monday, September 20, 2010, Kevin Cernekee wrote:
> Seen on MIPS32, gcc 4.4.3, 2.6.36-rc4:
>
> drivers/base/power/main.c: In function 'dpm_show_time':
> drivers/base/power/main.c:415: warning: comparison of distinct pointer types lacks a cast
>
> do_div() takes unsigned parameters:
>
> uint32_t do_div(uint64_t *n, uint32_t base);
>
> Using an unsigned variable for usecs64 should not cause any problems,
> because calltime >= starttime .
>
> Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OK, I'm going to apply it.
Thanks,
Rafael
> ---
> drivers/base/power/main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 276d5a7..db67719 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -407,7 +407,7 @@ static void pm_dev_err(struct device *dev, pm_message_t state, char *info,
> static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
> {
> ktime_t calltime;
> - s64 usecs64;
> + u64 usecs64;
> int usecs;
>
> calltime = ktime_get();
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-20 19:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20 18:33 [PATCH] PM: Fix signed/unsigned warning Kevin Cernekee
2010-09-20 19:27 ` 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