ipc/sem.c: remove code duplication
authorManfred Spraul <manfred@colorfullife.com>
Fri, 6 Jun 2014 21:37:48 +0000 (14:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2014 23:08:15 +0000 (16:08 -0700)
commit2f2ed41dcaec34f2d6f224aa84efcc5a9dd8d5c3
tree4122b855351d0747a49e47c4d675f0f83df7eafa
parent1994862dc9c16f360a9169a4d27200d15ba29713
ipc/sem.c: remove code duplication

count_semzcnt and count_semncnt are more of less identical.  The patch
creates a single function that either counts the number of tasks waiting
for zero or waiting due to a decrease operation.

Compared to the initial version, the BUG_ONs were removed.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/sem.c