From a7de7dee239e0055dda834ece1a456389200a2a2 Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Tue, 15 Sep 2020 11:51:40 +0000 Subject: [PATCH] nvme: remove superfluous else statement If the nvme completion was an error, the function will return, so there is no reason for an else statement. In fact, the else statement in nvme_ctrlr_identify_ns_async_done() differs from the coding style used in other nvme_ctrlr_identify_* functions, and arguably makes the code harder to read. Signed-off-by: Niklas Cassel Change-Id: If76b823b7ca04ab98abb2912927c344ee9f12314 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4265 Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Tested-by: SPDK CI Jenkins --- lib/nvme/nvme_ctrlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 967655d54..6a85745bf 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -1617,10 +1617,10 @@ nvme_ctrlr_identify_ns_async_done(void *arg, const struct spdk_nvme_cpl *cpl) if (spdk_nvme_cpl_is_error(cpl)) { nvme_ctrlr_set_state(ctrlr, NVME_CTRLR_STATE_ERROR, NVME_TIMEOUT_INFINITE); return; - } else { - nvme_ns_set_identify_data(ns); } + nvme_ns_set_identify_data(ns); + /* move on to the next active NS */ nsid = spdk_nvme_ctrlr_get_next_active_ns(ctrlr, ns->id); ns = spdk_nvme_ctrlr_get_ns(ctrlr, nsid);