From: janitor@sternwelten.at
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, domen@coderock.org
Subject: [patch 7/9] list_for_each_entry: fs-coda-psdev.c
Date: Sat, 20 Nov 2004 03:32:01 +0100 [thread overview]
Message-ID: <E1CVL2f-0000wS-G0@sputnik> (raw)
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>
---
linux-2.6.10-rc2-bk4-max/fs/coda/psdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff -puN fs/coda/psdev.c~list-for-each-entry-safe-fs_coda_psdev fs/coda/psdev.c
--- linux-2.6.10-rc2-bk4/fs/coda/psdev.c~list-for-each-entry-safe-fs_coda_psdev 2004-11-19 17:15:05.000000000 +0100
+++ linux-2.6.10-rc2-bk4-max/fs/coda/psdev.c 2004-11-19 17:15:05.000000000 +0100
@@ -310,8 +310,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 ) {
@@ -326,8 +325,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));
_
reply other threads:[~2004-11-20 2:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1CVL2f-0000wS-G0@sputnik \
--to=janitor@sternwelten.at \
--cc=akpm@osdl.org \
--cc=domen@coderock.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox