Skip to contentSkip to conversation

arm: struct semaphore.sleepers initialization

PATCH NAK Arthur Othieno 2 participants 2 messages Oct 29, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: struct semaphore.sleepers initialization

No one may sleep on us until we've been down()'d. So on allocation, initialize `sleepers' to 0, just like everyone else (including arm26).

---

 include/asm-arm/semaphore.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

bbf19d06faa9dc51fe084cc8d0b7fac933771528

include/asm-arm/semaphore.h +5 -4
@@ -18,10 +18,11 @@ struct semaphore {
 	wait_queue_head_t wait;
 };
 
-#define __SEMAPHORE_INIT(name, cnt)				\
-{								\
-	.count	= ATOMIC_INIT(cnt),				\
-	.wait	= __WAIT_QUEUE_HEAD_INITIALIZER((name).wait),	\
+#define __SEMAPHORE_INIT(name, cnt)					\
+{									\
+	.count		= ATOMIC_INIT(cnt),				\
+	.sleepers 	= 0,						\
+	.wait		= __WAIT_QUEUE_HEAD_INITIALIZER((name).wait),	\
 }
 
 #define __DECLARE_SEMAPHORE_GENERIC(name,count)	\
#1 lore raw
Quoted 2 lines · Arthur Othieno

No one may sleep on us until we've been down()'d. So on allocation, initialize `sleepers' to 0, just like everyone else (including arm26).

And the point of this patch is what exactly? Unnamed initialisers will be initialised to zero, so you haven't actually changed anything.

NACKed.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core