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>
Thu, 18 Mar 2021 05:17:51 +0000 (06:17 +0100)
commit7739770a67b47b3101971911c64f376c2f1e0a23
treeedaab6b52b1d172e0f71edf58cf9215cfae7d552
parent63ae22de703a07d586315fb8ef7247e60d547c14
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