mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
tipc: improve function tipc_wait_for_cond()
commit223b7329ec
upstream. Commit844cf763fb
("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>
This commit is contained in:
parent
311192b4ba
commit
bd37050a12
1 changed files with 1 additions and 1 deletions
|
@ -388,7 +388,7 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)
|
|||
rc_ = tipc_sk_sock_err((sock_), timeo_); \
|
||||
if (rc_) \
|
||||
break; \
|
||||
prepare_to_wait(sk_sleep(sk_), &wait_, TASK_INTERRUPTIBLE); \
|
||||
add_wait_queue(sk_sleep(sk_), &wait_); \
|
||||
release_sock(sk_); \
|
||||
*(timeo_) = wait_woken(&wait_, TASK_INTERRUPTIBLE, *(timeo_)); \
|
||||
sched_annotate_sleep(); \
|
||||
|
|
Loading…
Reference in a new issue