History

device property: Drop 'test' prefix in parameters of fwnode_is_ancestor_of()

The part 'is' in the function name implies the test against something. Drop unnecessary 'test' prefix in the fwnode_is_ancestor_of() parameters. No functional change intended.

Andy Shevchenko committed 4 years ago

Commit 022fe6b1 parent 87ffea02 files · +10 −13Browse files

Unified · Split

2 files
  1. drivers/base/property.c +9 −11
  2. include/linux/property.h +1 −2
drivers/base/property.c+9−11
@@ -656,28 +656,26 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode, · 655 unmodified lines
656EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);656EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
657 657
658/**658/**
659 * fwnode_is_ancestor_of - Test if @test_ancestor is ancestor of @test_child659 * fwnode_is_ancestor_of - Test if @ancestor is ancestor of @child
660 * @test_ancestor: Firmware which is tested for being an ancestor660 * @ancestor: Firmware which is tested for being an ancestor
661 * @test_child: Firmware which is tested for being the child661 * @child: Firmware which is tested for being the child
662 *662 *
663 * A node is considered an ancestor of itself too.663 * A node is considered an ancestor of itself too.
664 *664 *
665 * Returns true if @test_ancestor is an ancestor of @test_child.665 * Returns true if @ancestor is an ancestor of @child. Otherwise, returns false.
666 * Otherwise, returns false.
667 */666 */
668bool fwnode_is_ancestor_of(struct fwnode_handle *test_ancestor,667bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child)
669 struct fwnode_handle *test_child)
670{668{
671 struct fwnode_handle *parent;669 struct fwnode_handle *parent;
672 670
673 if (IS_ERR_OR_NULL(test_ancestor))671 if (IS_ERR_OR_NULL(ancestor))
674 return false;672 return false;
675 673
676 if (test_child == test_ancestor)674 if (child == ancestor)
677 return true;675 return true;
678 676
679 fwnode_for_each_parent_node(test_child, parent) {677 fwnode_for_each_parent_node(child, parent) {
680 if (parent == test_ancestor) {678 if (parent == ancestor) {
681 fwnode_handle_put(parent);679 fwnode_handle_put(parent);
682 return true;680 return true;
683 }681 }
include/linux/property.h+1−2
@@ -95,8 +95,7 @@ struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode); · 94 unmodified lines
95unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);95unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);
96struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,96struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
97 unsigned int depth);97 unsigned int depth);
98bool fwnode_is_ancestor_of(struct fwnode_handle *test_ancestor,98bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child);
99 struct fwnode_handle *test_child);
100struct fwnode_handle *fwnode_get_next_child_node(99struct fwnode_handle *fwnode_get_next_child_node(
101 const struct fwnode_handle *fwnode, struct fwnode_handle *child);100 const struct fwnode_handle *fwnode, struct fwnode_handle *child);
102struct fwnode_handle *fwnode_get_next_available_child_node(101struct fwnode_handle *fwnode_get_next_available_child_node(