]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc/sem.c: remove code duplication
authorManfred Spraul <manfred@colorfullife.com>
Thu, 22 May 2014 00:44:19 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:19 +0000 (10:44 +1000)
commit031beeca15e0cb9bfcb3d76cab2665bd079e411d
treee8e1fdfbf94e43ca812f1b7798e1fee439f742b8
parent3e39eb60b8ec1e2cd6c23a4f162bdb7e21f212a7
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>
ipc/sem.c