diff mbox series

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

Message ID 20240402022300.25858-1-zeming@nfschina.com
State New
Headers show
Series ext4: block_validity: Remove unnecessary ‘NULL’ values from new_node | expand

Commit Message

Li zeming April 2, 2024, 2:23 a.m. UTC
new_node is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/ext4/block_validity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Dilger April 8, 2024, 8:54 p.m. UTC | #1
On Apr 1, 2024, at 8:23 PM, Li zeming <zeming@nfschina.com> wrote:
> 
> new_node is assigned first, so it does not need to initialize the
> assignment.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
> fs/ext4/block_validity.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
> index 6fe3c941b5651..87ee3a17bd29c 100644
> --- a/fs/ext4/block_validity.c
> +++ b/fs/ext4/block_validity.c
> @@ -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.

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

Cheers, Andreas
diff mbox series

Patch

diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
index 6fe3c941b5651..87ee3a17bd29c 100644
--- a/fs/ext4/block_validity.c
+++ b/fs/ext4/block_validity.c
@@ -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;