Skip to contentSkip to conversation

ext4: block_validity: Remove unnecessary ‘NULL’ values from new_node

PATCH In review Li zeming 2 participants 2 messages Apr 2, 2024 – Apr 8, 2024 ext4 file system

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 ext4: block_validity: Remove unnecessary ‘NULL’ values from new_node

new_node is assigned first, so it does not need to initialize the assignment.

---
 fs/ext4/block_validity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/block_validity.c +1 -1
index 6fe3c941b5651..87ee3a17bd29c 100644
@@ -72,7 +72,7 @@ static int add_system_zone(struct ext4_system_blocks *system_blks,
 {
 	struct ext4_system_zone *new_entry, *entry;
 	struct rb_node **n = &system_blks->root.rb_node, *node;
-	struct rb_node *parent = NULL, *new_node = NULL;
+	struct rb_node *parent = NULL, *new_node;
 
 	while (*n) {
 		parent = *n;
Signature · 1 line
2.18.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Li zeming

new_node is assigned first, so it does not need to initialize the assignment.

---
fs/ext4/block_validity.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/block_validity.c +0 -0
index 6fe3c941b5651..87ee3a17bd29c 100644

fs/ext4/block_validity.c static int add_system_zone(struct ext4_system_blocks *system_blks, · line 75

Quoted 5 lines
fs/ext4/block_validity.c +1 -1
@@ -72,7 +72,7 @@ static int add_system_zone(struct ext4_system_blocks *system_blks,
 {
 	struct ext4_system_zone *new_entry, *entry;
 	struct rb_node **n = &system_blks->root.rb_node, *node;
-	struct rb_node *parent = NULL, *new_node = NULL;
+	struct rb_node *parent = NULL, *new_node;

This one is more compact and doesn't have the issue with the "cleanup" label at the end.

Cheers, Andreas