git: 68fcdba38b7e - main - LinuxKPI: Make lockdep*_pin_lock macros useable for drm-kmod
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 10 Jan 2022 19:50:39 UTC
The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=68fcdba38b7ea65b1f2f395fbd25fb59880d7163 commit 68fcdba38b7ea65b1f2f395fbd25fb59880d7163 Author: Vladimir Kondratyev <wulf@FreeBSD.org> AuthorDate: 2021-12-03 13:38:19 +0000 Commit: Vladimir Kondratyev <wulf@FreeBSD.org> CommitDate: 2022-01-10 19:49:37 +0000 LinuxKPI: Make lockdep*_pin_lock macros useable for drm-kmod Summary: - Add dummy struct pin_cookie definition; - Convert lockdep_pin_lock macro to function; - Fix 'unused variable' compile-time errors; MFC after: 1 week Reviewers: hselasky, manu Differential Revision: https://reviews.freebsd.org/D33295 --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index d12bd049b820..8f9dfab1cd25 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -38,6 +38,8 @@ struct lock_class_key { }; struct lockdep_map { }; +struct pin_cookie { +}; #define lockdep_set_class(lock, key) #define lockdep_set_subclass(lock, sub) @@ -69,9 +71,9 @@ lockdep_is_held(void *__m) #define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else -#define lockdep_assert_held(m) do { } while (0) +#define lockdep_assert_held(m) do { (void)(m); } while (0) -#define lockdep_assert_held_once(m) do { } while (0) +#define lockdep_assert_held_once(m) do { (void)(m); } while (0) #define lockdep_is_held(m) 1 #define lockdep_is_held_type(_m, _t) 1 @@ -92,8 +94,8 @@ lockdep_is_held(void *__m) #define lock_map_acquire_read(_map) do { } while (0) #define lock_map_release(_map) do { } while (0) -#define lockdep_pin_lock(l) do { } while (0) -#define lockdep_repin_lock(l,c) do { } while (0) -#define lockdep_unpin_lock(l,c) do { } while (0) +#define lockdep_pin_lock(l) ({ struct pin_cookie __pc = { }; __pc; }) +#define lockdep_repin_lock(l,c) do { (void)(l); (void)(c); } while (0) +#define lockdep_unpin_lock(l,c) do { (void)(l); (void)(c); } while (0) #endif /* _LINUX_LOCKDEP_H_ */