public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debug: Introduce a dev_WARN() function
@ 2008-09-20  4:07 Arjan van de Ven
  2008-09-20  4:08 ` [PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add() Arjan van de Ven
  2008-09-20  4:26 ` [PATCH] debug: Introduce a dev_WARN() function Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Arjan van de Ven @ 2008-09-20  4:07 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, greg


From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 19 Sep 2008 21:03:06 -0700
Subject: [PATCH] debug: Introduce a dev_WARN() function

in the line of dev_printk(), this patch introduces a dev_WARN() macro,
that takes a struct device and then a printk format/args set of arguments.
Unlike dev_printk(), the effect is that of WARN() in that a full warning
message (including filename/line, module list, versions and a backtrace)
is printed in addition to the device name and the arguments.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 include/linux/device.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index 4d8372d..2f9cdfa 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -539,6 +539,9 @@ extern const char *dev_driver_string(const struct device *dev);
 #define dev_info(dev, format, arg...)		\
 	dev_printk(KERN_INFO , dev , format , ## arg)
 
+#define dev_WARN(dev, format, arg...) \
+	WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg)
+
 #ifdef DEBUG
 #define dev_dbg(dev, format, arg...)		\
 	dev_printk(KERN_DEBUG , dev , format , ## arg)
-- 
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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-09-20 22:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-20  4:07 [PATCH] debug: Introduce a dev_WARN() function Arjan van de Ven
2008-09-20  4:08 ` [PATCH] debug: use dev_WARN() rather than WARN_ON() in device_pm_add() Arjan van de Ven
2008-09-20  4:26 ` [PATCH] debug: Introduce a dev_WARN() function 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox