bdev/nvme: fix the compilation warning for unused variable.

The error message is:

bdev_nvme.c:456:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
  456 |  int rc;

Reason: The CI testing pool will always use --enable-debug, but without this
flag, we will see complilation warning.

If we really want to catch this, it is better to really use this rc variable and print
some information.

Change-Id: Iec0ffcec4ec091d36044e3b36a9ac85e677b5c70
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3001
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ziye Yang 2020-06-23 19:44:03 +08:00 committed by Tomasz Zawadzki
parent 465b2f8a6b
commit d81d7a2c22

View File

@ -498,7 +498,12 @@ bdev_nvme_reset(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, struct nvme_bdev_io *bi
* Allows for round robin through multiple connections.
*/
rc = spdk_nvme_ctrlr_set_trid(nvme_bdev_ctrlr->ctrlr, &multipath_trid->trid);
assert(rc == 0);
if (rc) {
SPDK_ERRLOG("Failed to set the transport id for the nvme ctrlr=%p\n",
nvme_bdev_ctrlr->ctrlr);
/* Fail the application if the code comes here */
assert(rc == 0);
}
TAILQ_REMOVE(&nvme_bdev_ctrlr->multipath_trids, tmp_trid, link);
TAILQ_INSERT_TAIL(&nvme_bdev_ctrlr->multipath_trids, tmp_trid, link);
}