LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][next] nvmet: remove redundant assignments of variable status
@ 2021-07-06 14:56 Colin King
2021-07-06 18:26 ` Chaitanya Kulkarni
2021-07-16 7:53 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-07-06 14:56 UTC (permalink / raw)
To: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There are two occurrances where variable status is being assigned a
value that is never read and it is being re-assigned a new value
almost immediately afterwards on an error exit path. The assignments
are redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/nvme/target/zns.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index 17f8b7a45f21..46bc30fe85d2 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -115,14 +115,11 @@ void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req)
}
status = nvmet_req_find_ns(req);
- if (status) {
- status = NVME_SC_INTERNAL;
+ if (status)
goto done;
- }
if (!bdev_is_zoned(req->ns->bdev)) {
req->error_loc = offsetof(struct nvme_identify, nsid);
- status = NVME_SC_INVALID_NS | NVME_SC_DNR;
goto done;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] nvmet: remove redundant assignments of variable status
2021-07-06 14:56 [PATCH][next] nvmet: remove redundant assignments of variable status Colin King
@ 2021-07-06 18:26 ` Chaitanya Kulkarni
2021-07-16 7:53 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2021-07-06 18:26 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Sagi Grimberg, linux-nvme
Cc: kernel-janitors, linux-kernel
On 7/6/21 07:56, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> There are two occurrances where variable status is being assigned a
> value that is never read and it is being re-assigned a new value
> almost immediately afterwards on an error exit path. The assignments
> are redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
For now looks good.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] nvmet: remove redundant assignments of variable status
2021-07-06 14:56 [PATCH][next] nvmet: remove redundant assignments of variable status Colin King
2021-07-06 18:26 ` Chaitanya Kulkarni
@ 2021-07-16 7:53 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-07-16 7:53 UTC (permalink / raw)
To: Colin King
Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme,
kernel-janitors, linux-kernel
Thanks,
applied to nvme-5.15.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-16 7:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 14:56 [PATCH][next] nvmet: remove redundant assignments of variable status Colin King
2021-07-06 18:26 ` Chaitanya Kulkarni
2021-07-16 7:53 ` Christoph Hellwig
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).