public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: Pavel Machek <pavel@ucw.cz>, "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: <linux-pm@lists.linux-foundation.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] PM: Fix signed/unsigned warning
Date: Mon, 20 Sep 2010 11:33:32 -0700	[thread overview]
Message-ID: <8136c24e8aaf577b86dfdfc40b0d01e6@localhost> (raw)

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


             reply	other threads:[~2010-09-20 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 18:33 Kevin Cernekee [this message]
2010-09-20 19:27 ` [PATCH] PM: Fix signed/unsigned warning Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8136c24e8aaf577b86dfdfc40b0d01e6@localhost \
    --to=cernekee@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox