* [PATCH] Staging: gdm724x: Use list_next_entry instead of list_entry
@ 2016-03-06 14:56 Bhumika Goyal
2016-03-11 21:49 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2016-03-06 14:56 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Bhumika Goyal
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 <bhumirks@gmail.com>
---
drivers/staging/gdm724x/gdm_usb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c
index 9db9b90..a19d210 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: gdm724x: Use list_next_entry instead of list_entry
2016-03-06 14:56 [PATCH] Staging: gdm724x: Use list_next_entry instead of list_entry Bhumika Goyal
@ 2016-03-11 21:49 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-03-11 21:49 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: outreachy-kernel
On Sun, Mar 06, 2016 at 08:26:30PM +0530, Bhumika Goyal wrote:
> 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 <bhumirks@gmail.com>
> ---
> drivers/staging/gdm724x/gdm_usb.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Driver is no longer in the tree, sorry.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-11 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 14:56 [PATCH] Staging: gdm724x: Use list_next_entry instead of list_entry Bhumika Goyal
2016-03-11 21:49 ` [Outreachy kernel] " Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.