From 4e318631e4cf3e5dc4c931bf87dd82a5123add0c Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 2 Aug 2007 21:38:02 +0900 Subject: [PATCH] --- yaml --- r: 67954 b: refs/heads/master c: a7a0475497f9018e2e28cd421ee467d2ad68643e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/sysfs/dir.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 761b293382bf..9958e02c2d1e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 90bc61359de0148f8627073d68a22edc7ed9893d +refs/heads/master: a7a0475497f9018e2e28cd421ee467d2ad68643e diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index 837073dbadf4..5da8da806660 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -756,24 +756,19 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) { struct dentry *ret = NULL; - struct sysfs_dirent * parent_sd = dentry->d_parent->d_fsdata; - struct sysfs_dirent * sd; + struct sysfs_dirent *parent_sd = dentry->d_parent->d_fsdata; + struct sysfs_dirent *sd; struct bin_attribute *bin_attr; 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; + for (sd = parent_sd->s_children; sd; sd = sd->s_sibling) + if (sysfs_type(sd) && !strcmp(sd->s_name, dentry->d_name.name)) break; - } - } /* no such entry */ - if (!found) + if (!sd) goto out_unlock; /* attach dentry and inode */