public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: akpm@linux-foundation.org
Cc: Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org, greg@kroah.com
Subject: [PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
Date: Fri, 19 Sep 2008 21:08:42 -0700	[thread overview]
Message-ID: <20080919210842.0c5fdbba@infradead.org> (raw)
In-Reply-To: <20080919210733.4e9c58e8@infradead.org>


From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 19 Sep 2008 21:05:25 -0700
Subject: [PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add()

device_pm_add() has a WARN_ON that is showing up relatively high on
kerneloops.org, but unfortunately the WARN_ON is less than useful
in that it doesn't print any information about what device is causing
the issue.

This patch fixes this by turning the WARN_ON() into the newly
introduces dev_WARN() which will print information about the
device in question.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.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 bf6d355..b65667f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -83,7 +83,7 @@ void device_pm_add(struct device *dev)
 		 * transition is in progress in order to avoid leaving them
 		 * unhandled down the road
 		 */
-		WARN_ON(true);
+		dev_WARN(dev, "Parentless device registered during a PM transaction\n");
 	}
 
 	list_add_tail(&dev->power.entry, &dpm_list);
-- 
1.5.5.1



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2008-09-20  4:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-20  4:07 [PATCH] debug: Introduce a dev_WARN() function Arjan van de Ven
2008-09-20  4:08 ` Arjan van de Ven [this message]
2008-09-20  4:26 ` Greg KH
2008-09-20  6:13   ` Arjan van de Ven
2008-09-20 22:41     ` Randy Dunlap
2008-09-20 18:11   ` Arjan van de Ven
2008-09-20 20:14     ` Greg KH

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=20080919210842.0c5fdbba@infradead.org \
    --to=arjan@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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