
From: Jan Harkes <jaharkes@cs.cmu.edu>

Use list_for_each_entry_safe to make code more readable.  Compile tested.

Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/coda/psdev.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN fs/coda/psdev.c~coda-use-list_for_each_entry_safe fs/coda/psdev.c
--- 25/fs/coda/psdev.c~coda-use-list_for_each_entry_safe	2005-01-10 17:29:40.629710264 -0800
+++ 25-akpm/fs/coda/psdev.c	2005-01-10 17:29:40.632709808 -0800
@@ -309,8 +309,7 @@ static int coda_psdev_open(struct inode 
 static int coda_psdev_release(struct inode * inode, struct file * file)
 {
         struct venus_comm *vcp = (struct venus_comm *) file->private_data;
-        struct upc_req *req;
-	struct list_head *lh, *next;
+        struct upc_req *req, *tmp;
 
 	lock_kernel();
 	if ( !vcp->vc_inuse ) {
@@ -325,8 +324,7 @@ static int coda_psdev_release(struct ino
 	}
         
         /* Wakeup clients so they can return. */
-	list_for_each_safe(lh, next, &vcp->vc_pending) {
-		req = list_entry(lh, struct upc_req, uc_chain);
+	list_for_each_entry_safe(req, tmp, &vcp->vc_pending, uc_chain) {
 		/* Async requests need to be freed here */
 		if (req->uc_flags & REQ_ASYNC) {
 			CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
_
