git: 0ce38f6c0c82 - stable/14 - LinuxKPI: lockdep_assert: wrong 'cond' used in WARN_ON MACRO

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Thu, 01 Aug 2024 22:27:33 UTC
The branch stable/14 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=0ce38f6c0c822af3b41d9eb63669acef57dd9af9

commit 0ce38f6c0c822af3b41d9eb63669acef57dd9af9
Author:     Alvin Chen <weike.chen@dell.com>
AuthorDate: 2024-06-06 20:42:06 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-08-01 21:09:39 +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
    
    (cherry picked from commit 21f4cf5ccf87fd15d4d71f89d4c3ecab13f26146)
---
 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);		\