]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tipc: improve function tipc_wait_for_cond()
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Tue, 19 Feb 2019 04:20:47 +0000 (11:20 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:30:38 +0000 (08:30 +0100)
commit79f749ade7a61a56b9fe249a0a53ce8803b48b3e
tree387c678a907eabb93ba80d525b8b5081426dfa17
parentf9be5f664d059687420f3dea55223fa88eae3dda
tipc: improve function tipc_wait_for_cond()

commit 223b7329ec6a0dae1b7f7db7b770e93f4a069ef9 upstream.

Commit 844cf763fba6 ("tipc: make macro tipc_wait_for_cond() smp safe")
replaced finish_wait() with remove_wait_queue() but still used
prepare_to_wait(). This causes unnecessary conditional
checking  before adding to wait queue in prepare_to_wait().

This commit replaces prepare_to_wait() with add_wait_queue()
as the pair function with remove_wait_queue().

Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/socket.c