提交 d5261286 编写于 作者: G Guennadi Liakhovetski 提交者: Felipe Balbi

usb: renesas_usbhs: (cosmetic) simplify list operations

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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 6fecfb05
......@@ -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.
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册