Skip to contentSkip to conversation

lib/radix-tree: Remove unuse argument of insert_entries

PATCH In review wuchi 2 participants 2 messages Jun 24, 2022 Library code

lore
Share & tools
lore

wuchi

author
#0 lore raw

PATCH 1/1 lib/radix-tree: Remove unuse argument of insert_entries

Function insert_entries doesn't use the 'bool replace' argument, and the function is only used locally, remove the argument.

---
 lib/radix-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/radix-tree.c +2 -2
index b3afafe46fff..3c78e1e8b2ad 100644
@@ -677,7 +677,7 @@ static void radix_tree_free_nodes(struct radix_tree_node *node)
 }
 
 static inline int insert_entries(struct radix_tree_node *node,
-		void __rcu **slot, void *item, bool replace)
+		void __rcu **slot, void *item)
 {
 	if (*slot)
 		return -EEXIST;
@@ -711,7 +711,7 @@ int radix_tree_insert(struct radix_tree_root *root, unsigned long index,
 	if (error)
 		return error;
 
-	error = insert_entries(node, slot, item, false);
+	error = insert_entries(node, slot, item);
 	if (error < 0)
 		return error;
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 2 lines · wuchi

Function insert_entries doesn't use the 'bool replace' argument, and the function is only used locally, remove the argument.

Thanks. For these kinds of patches, I like the changelog to contain the historical context for when the code changed to make this argument unused. Can you add that?

Quoted 30 lines
---
 lib/radix-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/radix-tree.c +2 -2
index b3afafe46fff..3c78e1e8b2ad 100644
@@ -677,7 +677,7 @@ static void radix_tree_free_nodes(struct radix_tree_node *node)
 }
 
 static inline int insert_entries(struct radix_tree_node *node,
-		void __rcu **slot, void *item, bool replace)
+		void __rcu **slot, void *item)
 {
 	if (*slot)
 		return -EEXIST;
@@ -711,7 +711,7 @@ int radix_tree_insert(struct radix_tree_root *root, unsigned long index,
 	if (error)
 		return error;
 
-	error = insert_entries(node, slot, item, false);
+	error = insert_entries(node, slot, item);
 	if (error < 0)
 		return error;
 
Signature · 1 line
2.20.1