All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	luo penghao <luo.penghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH linux-next] loop: Remove redundant assignments and parentheses
Date: Wed,  8 Dec 2021 07:54:52 +0000	[thread overview]
Message-ID: <20211208075452.404867-1-luo.penghao@zte.com.cn> (raw)

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



                 reply	other threads:[~2021-12-08  7:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211208075452.404867-1-luo.penghao@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luo.penghao@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.