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

Michael Neuling mikey at neuling.org
Thu Feb 12 12:57:51 AEDT 2015


Avoids duplication of init values.

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

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);
-- 
2.1.0



More information about the Skiboot mailing list