diff options
author | Nathan Lynch <ntl@pobox.com> | 2008-08-12 17:34:57 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-20 02:34:58 -0400 |
commit | f3d3d307e6f577de3b384ef64ffb03c8b5676748 (patch) | |
tree | 895b7b126b79f91bf4c18b8410928f66cc986e6e /arch | |
parent | 8f6ba49207199cab60a4bdf43507666b93d12e18 (diff) |
powerpc: Remove redundant sysfs_remove_file calls for cache info
When removing a directory, the sysfs core takes care of removing files
in the directory (see sysfs_remove_dir()). So when we are about to
delete a kobject (and thus cause its sysfs directory to be removed),
we don't have to explicitly remove the files attached to it, although
it's harmless to do so.
Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/sysfs.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 56d172d16e56..12058db70095 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -641,16 +641,9 @@ static void remove_cache_info(struct sys_device *sysdev) | |||
641 | int cpu = sysdev->id; | 641 | int cpu = sysdev->id; |
642 | 642 | ||
643 | cache_desc = per_cpu(cache_desc, cpu); | 643 | cache_desc = per_cpu(cache_desc, cpu); |
644 | if (cache_desc != NULL) { | 644 | if (cache_desc != NULL) |
645 | sysfs_remove_file(&cache_desc->kobj, &cache_size_attr.attr); | ||
646 | sysfs_remove_file(&cache_desc->kobj, &cache_line_size_attr.attr); | ||
647 | sysfs_remove_file(&cache_desc->kobj, &cache_type_attr.attr); | ||
648 | sysfs_remove_file(&cache_desc->kobj, &cache_level_attr.attr); | ||
649 | sysfs_remove_file(&cache_desc->kobj, &cache_nr_sets_attr.attr); | ||
650 | sysfs_remove_file(&cache_desc->kobj, &cache_assoc_attr.attr); | ||
651 | |||
652 | kobject_put(&cache_desc->kobj); | 645 | kobject_put(&cache_desc->kobj); |
653 | } | 646 | |
654 | cache_toplevel = per_cpu(cache_toplevel, cpu); | 647 | cache_toplevel = per_cpu(cache_toplevel, cpu); |
655 | if (cache_toplevel != NULL) | 648 | if (cache_toplevel != NULL) |
656 | kobject_put(cache_toplevel); | 649 | kobject_put(cache_toplevel); |