diff mbox series

[22/75] backports: add lockdep_is_held() when needed

Message ID 20240627234808.1253337-23-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

If lockdep is not enabled and lockdep_is_held() not already defined
as a macro, declare it as an inline just like upstream does now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/lockdep.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h
index 842e24b7..8295b0d4 100644
--- a/backport/backport-include/linux/lockdep.h
+++ b/backport/backport-include/linux/lockdep.h
@@ -9,6 +9,13 @@  struct lockdep_map { };
 #endif /* CONFIG_LOCKDEP */
 #endif /* LINUX_VERSION_IS_LESS(4,15,0) */
 
+#if LINUX_VERSION_IS_LESS(5,11,0)
+#if !defined(CONFIG_LOCKDEP) && !defined(lockdep_is_held)
+/* upstream since 5.11 in this exact same way - calls compile away */
+int lockdep_is_held(const void *);
+#endif
+#endif
+
 #ifndef lockdep_assert_not_held
 #ifdef CONFIG_LOCKDEP
 #ifndef LOCK_STATE_HELD