Skip to contentSkip to conversation

ocfs2: remove redundant assignment to pointer root_bh

PATCH Applied Colin Ian King 2 participants 2 messages Dec 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: remove redundant assignment to pointer root_bh

Pointer root_bh is being initialized with a value that is not read, it is being re-assigned later on closer to its use. The early initialization is redundant and can be removed.

---
 fs/ocfs2/alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/alloc.c +1 -1
index bb247bc349e4..bf9357123bc5 100644
@@ -2040,7 +2040,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle,
 	int i, idx;
 	struct ocfs2_extent_list *el, *left_el, *right_el;
 	struct ocfs2_extent_rec *left_rec, *right_rec;
-	struct buffer_head *root_bh = left_path->p_node[subtree_index].bh;
+	struct buffer_head *root_bh;
 
 	/*
 	 * Update the counts and position values within all the
Signature · 1 line
2.33.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Colin Ian King

Pointer root_bh is being initialized with a value that is not read, it is being re-assigned later on closer to its use. The early initialization is redundant and can be removed.

Quoted 17 lines
---
 fs/ocfs2/alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/alloc.c +1 -1
index bb247bc349e4..bf9357123bc5 100644
@@ -2040,7 +2040,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle,
 	int i, idx;
 	struct ocfs2_extent_list *el, *left_el, *right_el;
 	struct ocfs2_extent_rec *left_rec, *right_rec;
-	struct buffer_head *root_bh = left_path->p_node[subtree_index].bh;
+	struct buffer_head *root_bh;
 
 	/*
 	 * Update the counts and position values within all the