Skip to content

Commit

Permalink
usb: renesas_usbhs: (cosmetic) simplify list operations
Browse files Browse the repository at this point in the history
list.h already provide helpers to find the first entry and to move list
nodes to the tail of another list. This patch simply uses those helpers,
no functional changes.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
lyakh authored and Felipe Balbi committed Feb 14, 2012
1 parent 6fecfb0 commit d526128
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/renesas_usbhs/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
pipe->handler = &usbhsf_null_handler;
}

list_del_init(&pkt->node);
list_add_tail(&pkt->node, &pipe->list);
list_move_tail(&pkt->node, &pipe->list);

/*
* each pkt must hold own handler.
Expand Down Expand Up @@ -107,7 +106,7 @@ static struct usbhs_pkt *__usbhsf_pkt_get(struct usbhs_pipe *pipe)
if (list_empty(&pipe->list))
return NULL;

return list_entry(pipe->list.next, struct usbhs_pkt, node);
return list_first_entry(&pipe->list, struct usbhs_pkt, node);
}

struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
Expand Down

0 comments on commit d526128

Please sign in to comment.