linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 v3] usb: renesas_usbhs: (cosmetic) simplify list operations
@ 2012-02-14 10:37 Guennadi Liakhovetski
  2012-02-14 11:45 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2012-02-14 10:37 UTC (permalink / raw)
  To: linux-sh

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>
---

v3: added a description, as suggested by Felipe, thanks

 drivers/usb/renesas_usbhs/fifo.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 72339bd..5d543e3 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -75,8 +75,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.
@@ -106,7 +105,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)
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2 v3] usb: renesas_usbhs: (cosmetic) simplify list operations
  2012-02-14 10:37 [PATCH 1/2 v3] usb: renesas_usbhs: (cosmetic) simplify list operations Guennadi Liakhovetski
@ 2012-02-14 11:45 ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2012-02-14 11:45 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

On Tue, Feb 14, 2012 at 11:37:17AM +0100, Guennadi Liakhovetski wrote:
> 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>

applied, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-14 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 10:37 [PATCH 1/2 v3] usb: renesas_usbhs: (cosmetic) simplify list operations Guennadi Liakhovetski
2012-02-14 11:45 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).