Skip to content

Commit

Permalink
sysfs: cosmetic changes in sysfs_lookup()
Browse files Browse the repository at this point in the history
* remove space between * and symbol name in variable declaration.

* kill unnecessary new line.

* kill 'found' and test 'sd' instead.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 90bc613 commit a7a0475
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit a7a0475

Please sign in to comment.