[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191120143619.1027-2-geert+renesas@glider.be>
Date: Wed, 20 Nov 2019 15:36:18 +0100
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH 1/2] driver core: Add dev_WARN_ON() helper
It is quite useful to print the related device in a warning backtrace.
Hence add a "dev_*" variant of WARN_ON() to handle this.
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
include/linux/device.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index f05c5b92e61f535a..05089c329620472a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1902,6 +1902,9 @@ do { \
WARN_ONCE(condition, "%s %s: " format, \
dev_driver_string(dev), dev_name(dev), ## arg)
+#define dev_WARN_ON(dev, condition) \
+ WARN(condition, "%s %s", dev_driver_string(dev), dev_name(dev))
+
/* Create alias, so I can be autoloaded. */
#define MODULE_ALIAS_CHARDEV(major,minor) \
MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
--
2.17.1
Powered by blists - more mailing lists