From: Eric W. Biederman Date: Mon, 20 Aug 2007 12:36:30 +0000 (+0900) Subject: sysfs: In sysfs_lookup don't open code sysfs_find_dirent X-Git-Tag: v2.6.24-rc1~1394^2~32 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=94777e09180b6249d455baa2dbe34cf630e0c033;p=karo-tx-linux.git sysfs: In sysfs_lookup don't open code sysfs_find_dirent This is a small cleanup patch that makes the code just a little bit cleaner. Signed-off-by: Eric W. Biederman Signed-off-by: Tejun Heo Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 7f4abe176701..b72b42ed80d1 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -756,9 +756,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, 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)) - break; + sd = sysfs_find_dirent(parent_sd, dentry->d_name.name); /* no such entry */ if (!sd)