linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] loop: Remove duplicate assignments
@ 2021-11-04  6:45 cgel.zte
  2021-11-04 11:48 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-11-04  6:45 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, luo penghao, Zeal Robot

From: luo penghao <luo.penghao@zte.com.cn>

The assignment and operation there will be overwritten later, so
it should be deleted.

The clang_analyzer complains as follows:

drivers/block/loop.c:2330:2 warning:

Value stored to 'err' is never read

change in v2:

Repair the sending email box

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

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1f91bd4..941b482 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2329,7 +2329,6 @@ static int loop_add(int i)
 		goto out_free_dev;
 	i = err;
 
-	err = -ENOMEM;
 	lo->tag_set.ops = &loop_mq_ops;
 	lo->tag_set.nr_hw_queues = 1;
 	lo->tag_set.queue_depth = 128;
-- 
2.15.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] loop: Remove duplicate assignments
  2021-11-04  6:45 [PATCH v2] loop: Remove duplicate assignments cgel.zte
@ 2021-11-04 11:48 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-11-04 11:48 UTC (permalink / raw)
  To: cgel.zte; +Cc: luo penghao, linux-block, linux-kernel, Zeal Robot

On Thu, 4 Nov 2021 06:45:46 +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
> 
> The assignment and operation there will be overwritten later, so
> it should be deleted.
> 
> The clang_analyzer complains as follows:
> 
> [...]

Applied, thanks!

[1/1] loop: Remove duplicate assignments
      commit: 18c6c96897a3b1ba44ab4df7324bf0b3454e090b

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-04 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04  6:45 [PATCH v2] loop: Remove duplicate assignments cgel.zte
2021-11-04 11:48 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).