Staging: gdm724x: Use list_next_entry instead of list_entry
PATCH 1/1 Staging: gdm724x: Use list_next_entry instead of list_entry
This patch replace list_entry with list_next_entry as it makes the code more clear to read.
Done using coccinelle:
@@
expression e1;
identifier e3;
type t;
@@
(
- list_entry(e1->e3.next,t,e3)
+ list_next_entry(e1,e3)
|
- list_entry(e1->e3.prev,t,e3)
+ list_prev_entry(e1,e3)
)
Signed-off-by Bhumika Goyal <[email protected]>
--- drivers/staging/gdm724x/gdm_usb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/gdm724x/gdm_usb.c +2 -3
@@ -227,7 +227,7 @@ static struct usb_rx *get_rx_struct(struct rx_cxt *rx, int *no_spc)return NULL ; } - r = list_entry(rx->free_list.next, struct usb_rx, free_list); + r =list_next_entry (rx, free_list);list_del (&r->free_list); rx->avail_count--;
@@ -402,8 +402,7 @@ static void do_rx(struct work_struct *work)spin_unlock_irqrestore (&rx->to_host_lock, flags);break ; } - r =list_entry (rx->to_host_list.next, - struct usb_rx, to_host_list); + r =list_next_entry (rx, to_host_list);list_del (&r->to_host_list);spin_unlock_irqrestore (&rx->to_host_lock, flags);
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 17 lines · Bhumika Goyal
This patch replace
list_entrywithlist_next_entryas it makes the code more clear to read.
Done using coccinelle:@@
expression e1;
identifier e3;
type t;
@@
(
-list_entry(e1->e3.next,t,e3)
+list_next_entry(e1,e3)
|
-list_entry(e1->e3.prev,t,e3)
+list_prev_entry(e1,e3)
)
Quoted 4 lines
Signed-off-by Bhumika Goyal <[email protected]>--- drivers/staging/gdm724x/gdm_usb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Driver is no longer in the tree, sorry.