USB: FHCI: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 06:41:44 +0000 (14:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2012 23:55:18 +0000 (16:55 -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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/fhci-sched.c

index 2dc8a40e39d76e5d73023fdd7e433173ef5b01cf..8f18538e0ff752ceef59e44381a5a00bc2e9ce6b 100644 (file)
@@ -261,8 +261,7 @@ static void move_head_to_tail(struct list_head *list)
        struct list_head *node = list->next;
 
        if (!list_empty(list)) {
-               list_del(node);
-               list_add_tail(node, list);
+               list_move_tail(node, list);
        }
 }