diff mbox

[02/10] Use LOCK_UNLOCKED macro to in init_lock()

Message ID 1423706279-12170-2-git-send-email-mikey@neuling.org
State Accepted
Headers show

Commit Message

Michael Neuling Feb. 12, 2015, 1:57 a.m. UTC
Avoids duplication of init values.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 include/lock.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/include/lock.h b/include/lock.h
index 823160a..0ac943d 100644
--- a/include/lock.h
+++ b/include/lock.h
@@ -60,8 +60,7 @@  extern bool bust_locks;
 
 static inline void init_lock(struct lock *l)
 {
-	l->lock_val = 0;
-	l->in_con_path = false;
+	*l = (struct lock)LOCK_UNLOCKED;
 }
 
 extern bool __try_lock(struct lock *l);