linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3][-mm] add class_reclassify macro
@ 2008-05-20  9:55 Dave Young
  2008-05-20 10:02 ` Andrew Morton
  0 siblings, 1 reply; 15+ messages in thread
From: Dave Young @ 2008-05-20  9:55 UTC (permalink / raw)
  To: akpm; +Cc: greg, matthew, kay.sievers, linux-kernel, linux-scsi

Converting class semaphore to mutex cause lockdep warnings due to
class_interface_register/unregister will possible call device_add/del

For the class_interface users here add a class_reclassify macro to
reclassify the lock class of their struct class.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>

---
include/linux/device.h |    7 +++++++
1 file changed, 7 insertions(+)

--- linux/include/linux/device.h	2008-05-19 12:29:54.000000000 +0800
+++ linux.new/include/linux/device.h	2008-05-19 14:42:25.000000000 +0800
@@ -529,4 +529,11 @@ extern const char *dev_driver_string(str
 	MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
 #define MODULE_ALIAS_CHARDEV_MAJOR(major) \
 	MODULE_ALIAS("char-major-" __stringify(major) "-*")
+
+#define class_reclassify(class)						\
+do {									\
+	static struct lock_class_key	class_key;			\
+	lockdep_set_class_and_name(&(class)->mutex, &class_key,		\
+				 (class)->name);			\
+} while (0)
 #endif /* _DEVICE_H_ */

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

end of thread, other threads:[~2008-05-28 16:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20  9:55 [PATCH 1/3][-mm] add class_reclassify macro Dave Young
2008-05-20 10:02 ` Andrew Morton
2008-05-20 11:05   ` Dave Young
2008-05-20 17:30     ` Andrew Morton
2008-05-20 17:36       ` Matthew Wilcox
2008-05-20 19:23         ` Andrew Morton
2008-05-21  2:05           ` Dave Young
2008-05-20 11:36   ` Matthew Wilcox
2008-05-20 17:21   ` Greg KH
2008-05-27  6:42     ` Dave Young
2008-05-27  6:59       ` Andrew Morton
2008-05-27  7:31         ` Dave Young
2008-05-28 15:48         ` Matthew Wilcox
2008-05-28 16:06           ` Greg KH
2008-05-28 16:28             ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).