public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Cheng <crquan@gmail.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, cr_quan@163.com
Subject: [PATCH] vfs: use list_for_each_entry instead
Date: Thu, 16 Aug 2007 11:28:16 +0800	[thread overview]
Message-ID: <11872348963990-git-send-email-crquan@gmail.com> (raw)

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 fs/super.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index fc8ebed..f287c15 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -334,15 +334,12 @@ struct super_block *sget(struct file_system_type *type,
 			int (*set)(struct super_block *,void *),
 			void *data)
 {
-	struct super_block *s = NULL;
-	struct list_head *p;
+	struct super_block *s = NULL, *old;
 	int err;
 
 retry:
 	spin_lock(&sb_lock);
-	if (test) list_for_each(p, &type->fs_supers) {
-		struct super_block *old;
-		old = list_entry(p, struct super_block, s_instances);
+	if (test) list_for_each_entry(old, &type->fs_supers, s_instances) {
 		if (!test(old, data))
 			continue;
 		if (!grab_super(old))
-- 
1.5.3.rc4


                 reply	other threads:[~2007-08-16  3:28 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=11872348963990-git-send-email-crquan@gmail.com \
    --to=crquan@gmail.com \
    --cc=cr_quan@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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