]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: remove unnecessary ctrl parameter
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 10 Mar 2021 01:16:32 +0000 (17:16 -0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 16:48:27 +0000 (18:48 +0200)
commitd5b7cfd30acb3da8de24ce8308fa486a7e359e43
tree0792b9339a3e8dc0713d9ae4b8e33e4bd5d3a2d9
parent8fb1cd8cdf6dc55ca2a4f72b06595768475aec78
nvmet: remove unnecessary ctrl parameter

The function nvmet_ctrl_find_get() accepts out pointer to nvmet_ctrl
structure. This function returns the same error value from two places
that is :- NVME_SC_CONNECT_INVALID_PARAM | NVME_SC_DNR.

Move this to the caller so we can change the return type to nvmet_ctrl.

Now that we can changed the return type, instead of taking out pointer
to the nvmet_ctrl structure remove that function parameter and return
the valid nvmet_ctrl pointer on success and NULL on failure.

Also, add and rename the goto labels for more readability with comments.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c
drivers/nvme/target/fabrics-cmd.c
drivers/nvme/target/nvmet.h