diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-17 12:47:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-17 12:47:47 -0700 |
commit | a6b52a9db891e2a39e8a0fed6005935d8b1aa59c (patch) | |
tree | 3fbef9df274667d1e96894c2b8c373b7192cfaf1 /include/acpi/platform/aclinux.h | |
parent | 247dc220f410969b35f884f1554fe9b78119dd59 (diff) | |
parent | 7fb574a97f7147610c44cef55d0cde2409392a80 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: Fixes device power states array overflow
ACPI, APEI, HEST, Detect duplicated hardware error source ID
ACPI: Fix lockdep false positives in acpi_power_off()
Diffstat (limited to 'include/acpi/platform/aclinux.h')
-rw-r--r-- | include/acpi/platform/aclinux.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 5d2a5e9544d9d..2ce1be9f62918 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) } while (0) #endif +/* + * When lockdep is enabled, the spin_lock_init() macro stringifies it's + * argument and uses that as a name for the lock in debugging. + * By executing spin_lock_init() in a macro the key changes from "lock" for + * all locks to the name of the argument of acpi_os_create_lock(), which + * prevents lockdep from reporting false positives for ACPICA locks. + */ +#define acpi_os_create_lock(__handle) \ +({ \ + spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ + \ + if (lock) { \ + *(__handle) = lock; \ + spin_lock_init(*(__handle)); \ + } \ + lock ? AE_OK : AE_NO_MEMORY; \ +}) + #endif /* __KERNEL__ */ #endif /* __ACLINUX_H__ */ |