public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include/linux/rbtree.h: move the declaration of c in rb_find_add()
@ 2023-04-18 14:57 Lin Chun Yeh
  2023-04-18 17:49 ` kernel test robot
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Lin Chun Yeh @ 2023-04-18 14:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lin Chun Yeh

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@g.ntu.edu.tw>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-19  3:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 14:57 [PATCH] include/linux/rbtree.h: move the declaration of c in rb_find_add() Lin Chun Yeh
2023-04-18 17:49 ` kernel test robot
2023-04-18 17:49 ` kernel test robot
2023-04-18 18:00 ` kernel test robot
2023-04-18 19:12 ` kernel test robot
2023-04-19  3:54 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox