diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-11-15 15:46:07 -0500 |
---|---|---|
committer | Henrik Aberg <henrik.aberg@stericsson.com> | 2011-02-02 10:29:07 +0100 |
commit | 9ccb571dd876623ed3eb29bc04cf023b90003e8f (patch) | |
tree | a1ef5ac29b9ff6e2b4f1c6c7732c7dfb83418717 /fs | |
parent | 74d62bd437c3149a8796801922bb19d1d1b28881 (diff) |
sysfs: remove useless test from sysfs_merge_group
Dan Carpenter pointed out that the new sysfs_merge_group() and
sysfs_unmerge_group() routines requires their grp argument to be
non-NULL, because they dereference grp to obtain the list of
attributes. Hence it's pointless for the routines to include a test
and special-case handling for when grp is NULL. This patch (as1433)
removes the unneeded tests.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ST-Ericsson Linux next: -
ST-Ericsson ID: AP317082
ST-Ericsson FOSS-OUT ID: -
Change-Id: I307d19adf2415b2806481977dd27874b23da4e4c
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13249
Tested-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Reviewed-by: QATOOLS
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/sysfs/group.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index 442f34ff1af..c8769dc222d 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -165,10 +165,7 @@ int sysfs_merge_group(struct kobject *kobj, struct attribute *const *attr; int i; - if (grp) - dir_sd = sysfs_get_dirent(kobj->sd, NULL, grp->name); - else - dir_sd = sysfs_get(kobj->sd); + dir_sd = sysfs_get_dirent(kobj->sd, NULL, grp->name); if (!dir_sd) return -ENOENT; @@ -195,10 +192,7 @@ void sysfs_unmerge_group(struct kobject *kobj, struct sysfs_dirent *dir_sd; struct attribute *const *attr; - if (grp) - dir_sd = sysfs_get_dirent(kobj->sd, NULL, grp->name); - else - dir_sd = sysfs_get(kobj->sd); + dir_sd = sysfs_get_dirent(kobj->sd, NULL, grp->name); if (dir_sd) { for (attr = grp->attrs; *attr; ++attr) sysfs_hash_and_remove(dir_sd, NULL, (*attr)->name); |