Skip to contentSkip to conversation

loop: remove redundant initialization of pointer node

PATCH Applied Colin Ian King 2 participants 2 messages Jan 13, 2022

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

PATCH 1/1 loop: remove redundant initialization of pointer node

The pointer node is being initialized with a value that is never read, it is being re-assigned the same value a little futher on. Remove the redundant initialization. Cleans up clang scan warning:

drivers/block/loop.c:823:19: warning: Value stored to 'node' during its initialization is never read [deadcode.DeadStores]

---
 drivers/block/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/loop.c +1 -1
index b1b05c45c07c..01cbbfc4e9e2 100644
@@ -820,7 +820,7 @@ static inline int queue_on_root_worker(struct cgroup_subsys_state *css)
 
 static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
 {
-	struct rb_node **node = &(lo->worker_tree.rb_node), *parent = NULL;
+	struct rb_node **node, *parent = NULL;
 	struct loop_worker *cur_worker, *worker = NULL;
 	struct work_struct *work;
 	struct list_head *cmd_list;
Signature · 1 line
2.33.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Colin Ian King

The pointer node is being initialized with a value that is never read, it is being re-assigned the same value a little futher on. Remove the redundant initialization. Cleans up clang scan warning:

drivers/block/loop.c:823:19: warning: Value stored to 'node' during its initialization is never read [deadcode.DeadStores]

[...]

Applied, thanks!

[1/1] loop: remove redundant initialization of pointer node

      commit: 413ec8057bc3d368574abd05dd27e747063b2f59

Best regards,

Signature · 1 line
Jens Axboe