linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1]  list_for_each_entry:  fs-coda-psdev.c
@ 2004-10-30 22:32 janitor
  2004-10-31  3:22 ` Jan Harkes
  0 siblings, 1 reply; 2+ messages in thread
From: janitor @ 2004-10-30 22:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, jaharkes, coda, janitor, domen




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-rc1-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-rc1/fs/coda/psdev.c~list-for-each-entry-safe-fs_coda_psdev	2004-10-24 17:04:07.000000000 +0200
+++ linux-2.6.10-rc1-max/fs/coda/psdev.c	2004-10-24 17:04:07.000000000 +0200
@@ -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));
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/1]  list_for_each_entry:  fs-coda-psdev.c
  2004-10-30 22:32 [patch 1/1] list_for_each_entry: fs-coda-psdev.c janitor
@ 2004-10-31  3:22 ` Jan Harkes
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Harkes @ 2004-10-31  3:22 UTC (permalink / raw)
  To: janitor; +Cc: akpm, linux-fsdevel, domen

On Sun, Oct 31, 2004 at 12:32:59AM +0200, janitor@sternwelten.at wrote:
> Use list_for_each_entry_safe to make code more readable.

I have no problem with this patch, I'm just wondering whether it is
really worth the trouble.

Readability isn't all that bad with the existing 2 lines. Code wise it
is identical, and if this is such a big deal why aren't the other
list_for_each/list_entry macros in the same file corrected as well?

Jan


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-31  3:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-30 22:32 [patch 1/1] list_for_each_entry: fs-coda-psdev.c janitor
2004-10-31  3:22 ` Jan Harkes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).