diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-06-15 20:34:09 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-06-30 23:38:28 +0200 |
commit | a8a047c84adcb9a023415f0c1336ba80bc47758e (patch) | |
tree | 7cd7433186e68eeea4814af821f1400f3b69b93c /backport | |
parent | 2666682960b0bb8a9dfdf3cca41690bb4f658a72 (diff) |
header: fix warning in lockdep_assert_held()
Upstream commit: 1b838d0c3845b344c598b4631327914cc509dd2e
When building the kernel there are lots of warnings like this:
drivers/net/wireless/ath/ath10k/ce.c:404:21: warning: unused variable ‘ar_pci’ [-Wunused-variable]
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
They are caused by an empty lockdep_assert_held() which does nothing
with this variable in kernel version < 3.9. This patch replaces this
macro with the version from a recent kernel and silence this warning.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/linux/lockdep.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h new file mode 100644 index 00000000..3974b8d7 --- /dev/null +++ b/backport/backport-include/linux/lockdep.h @@ -0,0 +1,17 @@ +#ifndef __BACKPORT_LINUX_LOCKDEP_H +#define __BACKPORT_LINUX_LOCKDEP_H +#include_next <linux/lockdep.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#undef lockdep_assert_held +#ifdef CONFIG_LOCKDEP +#define lockdep_assert_held(l) do { \ + WARN_ON(debug_locks && !lockdep_is_held(l)); \ + } while (0) +#else +#define lockdep_assert_held(l) do { (void)(l); } while (0) +#endif /* CONFIG_LOCKDEP */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */ + +#endif /* __BACKPORT_LINUX_LOCKDEP_H */ |