From a.beregalov@gmail.com Tue Dec 9 20:31:42 2008 From: Alexander Beregalov Date: Sun, 7 Dec 2008 05:32:46 +0300 Subject: Staging: usbip: switch to list_for_each_entry() To: gregkh@suse.de, adobriyan@gmail.com Message-ID: <20081207023246.GB21294@orion> From: Alexander Beregalov Signed-off-by: Alexander Beregalov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/stub_rx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c @@ -234,8 +234,6 @@ static void tweak_special_requests(struc 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 s 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;