[tip:locking/urgent] tools/liblockdep: Fix comparison of a boolean value with a value of 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  6c642e442e99af1ca026af55a16f23b5f8ee612a
Gitweb:     http://git.kernel.org/tip/6c642e442e99af1ca026af55a16f23b5f8ee612a
Author:     zhangdianfang <zhangdianfang@xxxxxxxxxx>
AuthorDate: Fri, 30 May 2014 08:37:28 +0800
Committer:  Sasha Levin <sasha.levin@xxxxxxxxxx>
CommitDate: Mon, 7 Jul 2014 12:02:21 -0400

tools/liblockdep: Fix comparison of a boolean value with a value of 2

Comparison of a boolean value (!__init_state) with a value of 2 (done)
as currently happens in the code is unlikely to succeed and causes
repeated initialization of the pthread function pointers.

Instead, remove boolean comparison so that we would initialize said
function pointers only once.

Ref: https://bugzilla.kernel.org/show_bug.cgi?id=76741
Cc: Jean Delvare <jdelvare@xxxxxxx>
Reported-by: David Binderman <dcb314@xxxxxxxxxxx>
Signed-off-by: Dianfang Zhang <zhangdianfang@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
---
 tools/lib/lockdep/preload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/lockdep/preload.c b/tools/lib/lockdep/preload.c
index 23bd69c..b5e52af 100644
--- a/tools/lib/lockdep/preload.c
+++ b/tools/lib/lockdep/preload.c
@@ -92,7 +92,7 @@ enum { none, prepare, done, } __init_state;
 static void init_preload(void);
 static void try_init_preload(void)
 {
-	if (!__init_state != done)
+	if (__init_state != done)
 		init_preload();
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux