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)
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));
......
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