public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/9]  list_for_each_entry:  arch-um-drivers-chan_kern.c
@ 2004-11-20  2:31 janitor
  2004-11-21  4:40 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: janitor @ 2004-11-20  2:31 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, janitor, domen







Make code more readable with list_for_each_reverse.

Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
---

 linux-2.6.10-rc2-bk4-max/arch/um/drivers/chan_kern.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

diff -puN arch/um/drivers/chan_kern.c~list-for-each-entry-drivers_chan_kern arch/um/drivers/chan_kern.c
--- linux-2.6.10-rc2-bk4/arch/um/drivers/chan_kern.c~list-for-each-entry-drivers_chan_kern	2004-11-19 17:14:47.000000000 +0100
+++ linux-2.6.10-rc2-bk4-max/arch/um/drivers/chan_kern.c	2004-11-19 17:14:47.000000000 +0100
@@ -218,7 +218,6 @@ void enable_chan(struct list_head *chans
 
 void close_chan(struct list_head *chans)
 {
-	struct list_head *ele;
 	struct chan *chan;
 
 	/* Close in reverse order as open in case more than one of them
@@ -226,8 +225,7 @@ void close_chan(struct list_head *chans)
 	 * state.  Then, the first one opened will have the original state,
 	 * so it must be the last closed.
 	 */
-        for(ele = chans->prev; ele != chans; ele = ele->prev){
-                chan = list_entry(ele, struct chan, list);
+	list_for_each_entry_reverse(chan, chans, list) {
 		if(!chan->opened) continue;
 		if(chan->ops->close != NULL)
 			(*chan->ops->close)(chan->fd, chan->data);
_

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

* Re: [patch 1/9] list_for_each_entry: arch-um-drivers-chan_kern.c
  2004-11-20  2:31 [patch 1/9] list_for_each_entry: arch-um-drivers-chan_kern.c janitor
@ 2004-11-21  4:40 ` Jeff Dike
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2004-11-21  4:40 UTC (permalink / raw)
  To: janitor; +Cc: akpm, linux-kernel, domen

janitor@sternwelten.at said:
> Make code more readable with list_for_each_reverse.
> Signed-off-by: Domen Puncer <domen@coderock.org> 
> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> 

OK by me.

		Jeff


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

end of thread, other threads:[~2004-11-21  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-20  2:31 [patch 1/9] list_for_each_entry: arch-um-drivers-chan_kern.c janitor
2004-11-21  4:40 ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox