[PATCH] include/linux/rbtree.h: move the declaration of c in rb_find_add()

From: Lin Chun Yeh
Date: Tue Apr 18 2023 - 10:59:31 EST


Move the declaration position of variable c in rb_find_add() to
maintain thedeclaration and used scope consistent with the c
variables, which have the same usage in rb_find() and
rb_find_first().

Signed-off-by: Lin Chun Yeh <r09921093@xxxxxxxxxxxx>
---
include/linux/rbtree.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index f7edca369..910c12382 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -225,11 +225,10 @@ rb_find_add(struct rb_node *node, struct rb_root *tree,
{
struct rb_node **link = &tree->rb_node;
struct rb_node *parent = NULL;
- int c;

while (*link) {
parent = *link;
- c = cmp(node, parent);
+ int c = cmp(node, parent);

if (c < 0)
link = &parent->rb_left;
--
2.34.1