]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
target: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 06:42:48 +0000 (14:42 +0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 18 Sep 2012 00:13:36 +0000 (17:13 -0700)
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>
drivers/target/sbp/sbp_target.c

index 4d979774463771c90bb6edc90842704a0f559f58..0ce44cd3488e43e397896a7ffe8da30e306301db 100644 (file)
@@ -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);