Skip to content

Commit

Permalink
target: use list_move_tail instead of list_del/list_add_tail
Browse files Browse the repository at this point in the history
Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Wei Yongjun authored and Nicholas Bellinger committed Sep 18, 2012
1 parent 06cda52 commit bf11eef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/target/sbp/sbp_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,7 @@ static void session_reconnect_expired(struct sbp_session *sess)
spin_lock_bh(&sess->lock);
list_for_each_entry_safe(login, temp, &sess->login_list, link) {
login->sess = NULL;
list_del(&login->link);
list_add_tail(&login->link, &login_list);
list_move_tail(&login->link, &login_list);
}
spin_unlock_bh(&sess->lock);

Expand Down

0 comments on commit bf11eef

Please sign in to comment.