diff mbox series

[v2] loop: Remove duplicate assignments

Message ID 20211104064546.3074-1-luo.penghao@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series [v2] loop: Remove duplicate assignments | expand

Commit Message

CGEL Nov. 4, 2021, 6:45 a.m. UTC
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(-)

Comments

Jens Axboe Nov. 4, 2021, 11:48 a.m. UTC | #1
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,
diff mbox series

Patch

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;