diff options
author | Tung Nguyen <tung.q.nguyen@dektech.com.au> | 2019-02-18 23:20:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-21 16:58:05 -0500 |
commit | 223b7329ec6a0dae1b7f7db7b770e93f4a069ef9 (patch) | |
tree | d846113e935508125817d023310a67eead06051e /net/tipc/socket.c | |
parent | 3c963a3306eada999be5ebf4f293dfa3d3945487 (diff) |
tipc: improve function tipc_wait_for_cond()
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>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 1217c90a363b..81b87916a0eb 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -388,7 +388,7 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout) | |||
388 | rc_ = tipc_sk_sock_err((sock_), timeo_); \ | 388 | rc_ = tipc_sk_sock_err((sock_), timeo_); \ |
389 | if (rc_) \ | 389 | if (rc_) \ |
390 | break; \ | 390 | break; \ |
391 | prepare_to_wait(sk_sleep(sk_), &wait_, TASK_INTERRUPTIBLE); \ | 391 | add_wait_queue(sk_sleep(sk_), &wait_); \ |
392 | release_sock(sk_); \ | 392 | release_sock(sk_); \ |
393 | *(timeo_) = wait_woken(&wait_, TASK_INTERRUPTIBLE, *(timeo_)); \ | 393 | *(timeo_) = wait_woken(&wait_, TASK_INTERRUPTIBLE, *(timeo_)); \ |
394 | sched_annotate_sleep(); \ | 394 | sched_annotate_sleep(); \ |