loop: Remove duplicate assignments
authorluo penghao <luo.penghao@zte.com.cn>
Thu, 4 Nov 2021 06:45:46 +0000 (06:45 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Nov 2021 11:47:53 +0000 (05:47 -0600)
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>
Link: https://lore.kernel.org/r/20211104064546.3074-1-luo.penghao@zte.com.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index 302ac8f4f8ac74fb492cbef15351ad96cc50982e..686b0a19f79450de287da805b584d4e6220dcb8a 100644 (file)
@@ -2003,7 +2003,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;