mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: vbyravarasu@nvidia.com
To: pavel@ucw.cz, rjw@sisk.pl, len.brown@intel.com, gregkh@suse.de
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	vbyravarasu@nvidia.com, pdeschrijver@nvidia.com
Subject: [PATCH v2] PM: fix runtime accounting calculation error
Date: Fri, 28 Oct 2011 14:15:02 +0530	[thread overview]
Message-ID: <1319791502-17937-1-git-send-email-vbyravarasu@nvidia.com> (raw)

From: venu byravarasu <vbyravarasu@nvidia.com>

With delta type being int, its value is made zero
for all values of now > 0x80000000.
Hence fixing it.

Signed-off-by: venu byravarasu <vbyravarasu@nvidia.com>
---
changes since v1:
Removed max_num and its usage references.
..........

 drivers/base/power/runtime.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 1079e03..e8a5172 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);
 void update_pm_runtime_accounting(struct device *dev)
 {
 	unsigned long now = jiffies;
-	int delta;
+	unsigned long delta;
 
 	delta = now - dev->power.accounting_timestamp;
 
-	if (delta < 0)
-		delta = 0;
-
 	dev->power.accounting_timestamp = now;
 
 	if (dev->power.disable_depth > 0)
-- 
1.7.1.1


             reply	other threads:[~2011-10-28  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  8:45 vbyravarasu [this message]
2011-10-28 11:51 ` Rafael J. Wysocki
2011-11-03  0:18 ` Rafael J. Wysocki
2011-11-03  3:17   ` Venu Byravarasu

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=1319791502-17937-1-git-send-email-vbyravarasu@nvidia.com \
    --to=vbyravarasu@nvidia.com \
    --cc=gregkh@suse.de \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pdeschrijver@nvidia.com \
    --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

all inboxes | Powered by JetHome®