aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-28 12:42:51 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-28 12:42:51 -0700
commit9667f0523182cd4fc2291b083bcc78d3126636d5 (patch)
treecdae19df23089b5fc05332b8340e92de46dfa9b3
parentc17f4c7b1e5f3b7acd83354f008721e12a9c9586 (diff)
downloadpatches-9667f0523182cd4fc2291b083bcc78d3126636d5.tar.gz
lockdep: change inline to define on advice of others
-rw-r--r--driver-core/class-add-lockdep-infrastructure.patch41
1 files changed, 26 insertions, 15 deletions
diff --git a/driver-core/class-add-lockdep-infrastructure.patch b/driver-core/class-add-lockdep-infrastructure.patch
index 493467aa2d6631..2feb9ea80f1e83 100644
--- a/driver-core/class-add-lockdep-infrastructure.patch
+++ b/driver-core/class-add-lockdep-infrastructure.patch
@@ -18,11 +18,13 @@ Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/class.c | 11 ++++++-----
- include/linux/device.h | 19 +++++++++++++++++--
- 2 files changed, 23 insertions(+), 7 deletions(-)
+ include/linux/device.h | 25 +++++++++++++++++++++++--
+ 2 files changed, 29 insertions(+), 7 deletions(-)
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -90,22 +92,27 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/module.h>
-@@ -200,7 +201,13 @@ struct class {
+@@ -200,8 +201,18 @@ struct class {
extern struct kobject *sysfs_dev_block_kobj;
extern struct kobject *sysfs_dev_char_kobj;
-extern int __must_check class_register(struct class *class);
+extern int __must_check __class_register(struct class *class,
+ struct lock_class_key *key);
-+static inline int __must_check class_register(struct class *class)
-+{
-+ static struct lock_class_key __key;
-+ return __class_register(class, &__key);
-+}
extern void class_unregister(struct class *class);
++
++/* This is a #define to keep the compiler from merging different
++ * instances of the __key variable */
++#define class_register(class) \
++({ \
++ static struct lock_class_key __key; \
++ __class_register(class, &__key); \
++})
++
extern int class_for_each_device(struct class *class, struct device *start,
void *data,
-@@ -234,7 +241,15 @@ struct class_interface {
+ int (*fn)(struct device *dev, void *data));
+@@ -234,9 +245,19 @@ struct class_interface {
extern int __must_check class_interface_register(struct class_interface *);
extern void class_interface_unregister(struct class_interface *);
@@ -113,12 +120,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+extern struct class * __must_check __class_create(struct module *owner,
+ const char *name,
+ struct lock_class_key *key);
-+static inline struct class * __must_check class_create(struct module *owner,
-+ const char *name)
-+{
-+ static struct lock_class_key __key;
-+ return __class_create(owner, name, &__key);
-+}
extern void class_destroy(struct class *cls);
++/* This is a #define to keep the compiler from merging different
++ * instances of the __key variable */
++#define class_create(owner, name) \
++({ \
++ static struct lock_class_key __key; \
++ __class_create(owner, name, &__key); \
++})
++
/*
+ * The type of device, "struct device" is embedded in. A class
+ * or bus can contain devices of different types