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)
commitde5878048e11f1ec44164ebb8994de132074367a
tree0792b9339a3e8dc0713d9ae4b8e33e4bd5d3a2d9
parentb53d47418d98dbf5cd082e756a9e4e2a426492d7
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