]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvmet: remove redundant assignment of error code in nvmet_ns_enable()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Wed, 25 Jun 2025 04:16:32 +0000 (21:16 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jul 2025 11:38:07 +0000 (13:38 +0200)
Remove the unnecessary ret = -EMFILE; assignment since it is immediately
overwritten by the result of nvmet_bdev_ns_enable() The initial value
(-EMFILE) is redundant because it has no effect on the code logic or
outcome.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c

index 175c5b6d4dd587f92b36d522f9e579c943b246dd..884286f90688aecd86a40d4632d185c69bb71f54 100644 (file)
@@ -581,8 +581,6 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
        if (ns->enabled)
                goto out_unlock;
 
-       ret = -EMFILE;
-
        ret = nvmet_bdev_ns_enable(ns);
        if (ret == -ENOTBLK)
                ret = nvmet_file_ns_enable(ns);