[PATCH 04/14] sysfs: Remove unnecessary variable found from sysfs_lookup

Eric W. Biederman ebiederm at xmission.com
Tue Jul 31 03:24:08 PDT 2007


The subject says it all.

Signed-off-by: Eric W. Biederman <ebiederm at xmission.com>
---
 fs/sysfs/dir.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 834ed74..8430633 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -748,19 +748,16 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
 	struct dentry *result = NULL;
 	struct sysfs_dirent * sd;
 	struct inode *inode;
-	int found = 0;
 
 	mutex_lock(&sysfs_mutex);
 	for (sd = parent_sd->s_children; sd; sd = sd->s_sibling) {
 		if (sysfs_type(sd) &&
-		    !strcmp(sd->s_name, dentry->d_name.name)) {
-			found = 1;
+		    !strcmp(sd->s_name, dentry->d_name.name))
 			break;
-		}
 	}
 
 	/* no such entry */
-	if (!found)
+	if (!sd)
 		goto out;
 
 	/* attach dentry and inode */
-- 
1.5.1.1.181.g2de0



More information about the Containers mailing list