2005-10-29 03:27:11

by a.othieno

[permalink] [raw]
Subject: [PATCH] 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).

Signed-off-by: Arthur Othieno <[email protected]>

---

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

bbf19d06faa9dc51fe084cc8d0b7fac933771528
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -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) \


2005-10-29 08:51:37

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] arm: struct semaphore.sleepers initialization

On Fri, Oct 28, 2005 at 11:26:35PM -0400, Arthur Othieno wrote:
> 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.

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