lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] loop: Remove redundant assignments and parentheses
Date
From: luo penghao <luo.penghao@zte.com.cn>

The assignment of node has been done during initialization, and
the parentheses are meaningless according to the priority.

drivers/block/loop.c:1001:19: warning
Value stored to 'node' during its initialization is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
drivers/block/loop.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index dfc72a1..0b74cbe 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -985,7 +985,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 = &lo->worker_tree.rb_node, *parent = NULL;
struct loop_worker *cur_worker, *worker = NULL;
struct work_struct *work;
struct list_head *cmd_list;
@@ -995,8 +995,6 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
if (queue_on_root_worker(cmd->blkcg_css))
goto queue_work;

- node = &lo->worker_tree.rb_node;
-
while (*node) {
parent = *node;
cur_worker = container_of(*node, struct loop_worker, rb_node);
--
2.15.2

\
 
 \ /
  Last update: 2021-12-08 08:56    [W:0.041 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site