git: 21f4cf5ccf87 - main - LinuxKPI: lockdep_assert: wrong 'cond' used in WARN_ON MACRO
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Jun 2024 20:42:55 UTC
The branch main has been updated by wulf:
URL: https://cgit.FreeBSD.org/src/commit/?id=21f4cf5ccf87fd15d4d71f89d4c3ecab13f26146
commit 21f4cf5ccf87fd15d4d71f89d4c3ecab13f26146
Author: Alvin Chen <weike.chen@dell.com>
AuthorDate: 2024-06-06 20:42:06 +0000
Commit: Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-06-06 20:42:06 +0000
LinuxKPI: lockdep_assert: wrong 'cond' used in WARN_ON MACRO
'cond' in WARN_ON need be bracketed,
otherwise it is wrong for multiple conditions.
Reviewed by: wulf
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44604
---
sys/compat/linuxkpi/common/include/linux/lockdep.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h
index a379e191aad7..5291be79218e 100644
--- a/sys/compat/linuxkpi/common/include/linux/lockdep.h
+++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h
@@ -50,8 +50,8 @@ struct pin_cookie {
#define lockdep_unregister_key(key) do { } while(0)
#ifdef INVARIANTS
-#define lockdep_assert(cond) do { WARN_ON(!cond); } while (0)
-#define lockdep_assert_once(cond) do { WARN_ON_ONCE(!cond); } while (0)
+#define lockdep_assert(cond) do { WARN_ON(!(cond)); } while (0)
+#define lockdep_assert_once(cond) do { WARN_ON_ONCE(!(cond)); } while (0)
#define lockdep_assert_not_held(m) do { \
struct lock_object *__lock = (struct lock_object *)(m); \