]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] code: ulist_for_each_entry_safe()
authorJan Harkes <jaharkes@cs.cmu.edu>
Tue, 11 Jan 2005 01:26:51 +0000 (17:26 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 01:26:51 +0000 (17:26 -0800)
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>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/coda/psdev.c

index f115e41d4ccaf8a5425931540570513e9c2b46ab..c2306b5f64565ee9c8c83f108e62576f691b7a80 100644 (file)
@@ -309,8 +309,7 @@ static int coda_psdev_open(struct inode * inode, struct file * file)
 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 inode * inode, struct file * file)
        }
         
         /* 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));