Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kay Sievers and committed by
Greg Kroah-Hartman
b3e8d7b2 a6ec0c03

-39
-2
include/linux/kobject.h
··· 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;
-37
lib/kobject.c
··· 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); ··· 758 790 } 759 791 } 760 792 761 - unlock_exit: 762 793 spin_unlock(&kset->list_lock); 763 - 764 - if (hint) 765 - kobject_put(hint); 766 - 767 794 return ret; 768 795 } 769 796