]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit70dc457894b3d8dc33cb884463bba3aeb276d240
tree4122b855351d0747a49e47c4d675f0f83df7eafa
parentceaba41339ad697da22c930e8a9015ad46c8fc66
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