Commit 9db7f451 authored by Jan Harkes's avatar Jan Harkes Committed by Linus Torvalds

[PATCH] code: ulist_for_each_entry_safe()

Use list_for_each_entry_safe to make code more readable.  Compile tested.
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e926095b
...@@ -309,8 +309,7 @@ static int coda_psdev_open(struct inode * inode, struct file * 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) static int coda_psdev_release(struct inode * inode, struct file * file)
{ {
struct venus_comm *vcp = (struct venus_comm *) file->private_data; struct venus_comm *vcp = (struct venus_comm *) file->private_data;
struct upc_req *req; struct upc_req *req, *tmp;
struct list_head *lh, *next;
lock_kernel(); lock_kernel();
if ( !vcp->vc_inuse ) { if ( !vcp->vc_inuse ) {
...@@ -325,8 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) ...@@ -325,8 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
} }
/* Wakeup clients so they can return. */ /* Wakeup clients so they can return. */
list_for_each_safe(lh, next, &vcp->vc_pending) { list_for_each_entry_safe(req, tmp, &vcp->vc_pending, uc_chain) {
req = list_entry(lh, struct upc_req, uc_chain);
/* Async requests need to be freed here */ /* Async requests need to be freed here */
if (req->uc_flags & REQ_ASYNC) { if (req->uc_flags & REQ_ASYNC) {
CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr)); CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment