]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: gdm72xx: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 06:49:15 +0000 (14:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2012 18:58:24 +0000 (11:58 -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/staging/gdm72xx/gdm_usb.c

index c7a22fa55638f45385b08d0e801d9dfe9a4775da..932a7974217eea93c999d03192b3116e780b7f1e 100644 (file)
@@ -178,8 +178,7 @@ static struct usb_rx *get_rx_struct(struct rx_cxt *rx)
        }
 
        r = list_entry(rx->free_list.next, struct usb_rx, list);
-       list_del(&r->list);
-       list_add_tail(&r->list, &rx->used_list);
+       list_move_tail(&r->list, &rx->used_list);
 
        return r;
 }