Commit b3e8d7b2478401b2f25f4566a90faad54f7d6d07

Authored by Kay Sievers
Committed by Greg Kroah-Hartman
1 parent a6ec0c03a0

kobject: remove kset_find_obj_hinted()

Now that there are no in-kernel users of this function, remove it as it
is no longer needed.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 0 additions and 39 deletions Side-by-side Diff

include/linux/kobject.h
... ... @@ -191,8 +191,6 @@
191 191 }
192 192  
193 193 extern struct kobject *kset_find_obj(struct kset *, const char *);
194   -extern struct kobject *kset_find_obj_hinted(struct kset *, const char *,
195   - struct kobject *);
196 194  
197 195 /* The global /sys/kernel/ kobject for people to chain off of */
198 196 extern struct kobject *kernel_kobj;
... ... @@ -746,43 +746,11 @@
746 746 */
747 747 struct kobject *kset_find_obj(struct kset *kset, const char *name)
748 748 {
749   - return kset_find_obj_hinted(kset, name, NULL);
750   -}
751   -
752   -/**
753   - * kset_find_obj_hinted - search for object in kset given a predecessor hint.
754   - * @kset: kset we're looking in.
755   - * @name: object's name.
756   - * @hint: hint to possible object's predecessor.
757   - *
758   - * Check the hint's next object and if it is a match return it directly,
759   - * otherwise, fall back to the behavior of kset_find_obj(). Either way
760   - * a reference for the returned object is held and the reference on the
761   - * hinted object is released.
762   - */
763   -struct kobject *kset_find_obj_hinted(struct kset *kset, const char *name,
764   - struct kobject *hint)
765   -{
766 749 struct kobject *k;
767 750 struct kobject *ret = NULL;
768 751  
769 752 spin_lock(&kset->list_lock);
770 753  
771   - if (!hint)
772   - goto slow_search;
773   -
774   - /* end of list detection */
775   - if (hint->entry.next == kset->list.next)
776   - goto slow_search;
777   -
778   - k = container_of(hint->entry.next, struct kobject, entry);
779   - if (!kobject_name(k) || strcmp(kobject_name(k), name))
780   - goto slow_search;
781   -
782   - ret = kobject_get(k);
783   - goto unlock_exit;
784   -
785   -slow_search:
786 754 list_for_each_entry(k, &kset->list, entry) {
787 755 if (kobject_name(k) && !strcmp(kobject_name(k), name)) {
788 756 ret = kobject_get(k);
789 757  
... ... @@ -790,12 +758,7 @@
790 758 }
791 759 }
792 760  
793   -unlock_exit:
794 761 spin_unlock(&kset->list_lock);
795   -
796   - if (hint)
797   - kobject_put(hint);
798   -
799 762 return ret;
800 763 }
801 764