Staging: usbip: switch to list_for_each_entry()
authorAlexander Beregalov <a.beregalov@gmail.com>
Sun, 7 Dec 2008 02:32:46 +0000 (05:32 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:52:32 +0000 (13:52 -0800)
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/usbip/stub_rx.c

index 2a2cc0f051cc1133f1f87a1526a299b0e0cf71e7..2eb61372fe0a6d9a446fb2897a802c3b792aa0f8 100644 (file)
@@ -234,8 +234,6 @@ static void tweak_special_requests(struct urb *urb)
 static int stub_recv_cmd_unlink(struct stub_device *sdev,
                                                struct usbip_header *pdu)
 {
-       struct list_head *listhead = &sdev->priv_init;
-       struct list_head *ptr;
        unsigned long flags;
 
        struct stub_priv *priv;
@@ -243,8 +241,7 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev,
 
        spin_lock_irqsave(&sdev->priv_lock, flags);
 
-       for (ptr = listhead->next; ptr != listhead; ptr = ptr->next) {
-               priv = list_entry(ptr, struct stub_priv, list);
+       list_for_each_entry(priv, &sdev->priv_init, list) {
                if (priv->seqnum == pdu->u.cmd_unlink.seqnum) {
                        int ret;