nvme: Clean up redundant arguments in transport_ctrlr_construct

The other simplifications to probe_info and trid made the
trtype argument redundant.

Change-Id: Ie7bea4e2204e690dc4909eeacd065e0722b53272
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2016-12-09 15:14:45 -07:00 committed by Daniel Verkamp
parent 32e838af3c
commit ec0b5d2ba1
8 changed files with 21 additions and 34 deletions

View File

@ -311,7 +311,7 @@ nvme_ctrlr_probe(const struct spdk_nvme_transport_id *trid, void *devhandle,
spdk_nvme_ctrlr_opts_set_defaults(&opts);
if (probe_cb(cb_ctx, trid, &opts)) {
ctrlr = nvme_transport_ctrlr_construct(trid->trtype, &opts, trid, devhandle);
ctrlr = nvme_transport_ctrlr_construct(trid, &opts, devhandle);
if (ctrlr == NULL) {
SPDK_ERRLOG("Failed to construct NVMe controller\n");
return -1;

View File

@ -564,8 +564,8 @@ void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme
/* Transport specific functions */
#define DECLARE_TRANSPORT(name) \
struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(enum spdk_nvme_transport_type trtype, const struct spdk_nvme_ctrlr_opts *opts, \
const struct spdk_nvme_transport_id *trid, void *devhandle); \
struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(const struct spdk_nvme_transport_id *trid, const struct spdk_nvme_ctrlr_opts *opts, \
void *devhandle); \
int nvme_ ## name ## _ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr); \
int nvme_ ## name ## _ctrlr_scan(const struct spdk_nvme_transport_id *trid, void *cb_ctx, spdk_nvme_probe_cb probe_cb, spdk_nvme_remove_cb remove_cb); \
int nvme_ ## name ## _ctrlr_attach(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx, struct spdk_pci_addr *addr); \

View File

@ -582,9 +582,8 @@ nvme_pcie_ctrlr_attach(enum spdk_nvme_transport_type trtype,
return spdk_pci_nvme_device_attach(pcie_nvme_enum_cb, &enum_ctx, pci_addr);
}
struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(enum spdk_nvme_transport_type trtype,
struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
{
struct spdk_pci_device *pci_dev = devhandle;

View File

@ -1070,9 +1070,7 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid,
discovery_opts.keep_alive_timeout_ms = 0;
memset(buffer, 0x0, 4096);
discovery_ctrlr = nvme_rdma_ctrlr_construct(SPDK_NVME_TRANSPORT_RDMA, &discovery_opts,
discovery_trid,
NULL);
discovery_ctrlr = nvme_rdma_ctrlr_construct(discovery_trid, &discovery_opts, NULL);
if (discovery_ctrlr == NULL) {
return -1;
}
@ -1156,11 +1154,9 @@ nvme_rdma_ctrlr_attach(enum spdk_nvme_transport_type trtype,
return -1;
}
struct spdk_nvme_ctrlr *
nvme_rdma_ctrlr_construct(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
struct spdk_nvme_ctrlr *nvme_rdma_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
void *devhandle)
{
struct nvme_rdma_ctrlr *rctrlr;
union spdk_nvme_cap_register cap;

View File

@ -81,13 +81,11 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype)
return false;
}
struct spdk_nvme_ctrlr *
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
void *devhandle)
{
NVME_TRANSPORT_CALL(trtype, ctrlr_construct, (trtype, opts, trid, devhandle));
NVME_TRANSPORT_CALL(trid->trtype, ctrlr_construct, (trid, opts, devhandle));
}
int

View File

@ -61,11 +61,9 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype)
return true;
}
struct spdk_nvme_ctrlr *
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
void *devhandle)
{
return NULL;
}

View File

@ -56,11 +56,9 @@ struct spdk_nvme_registers g_ut_nvme_regs = {};
__thread int nvme_thread_ioq_index = -1;
struct spdk_nvme_ctrlr *
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
void *devhandle)
{
return NULL;
}

View File

@ -75,11 +75,9 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype)
return true;
}
struct spdk_nvme_ctrlr *
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
const struct spdk_nvme_ctrlr_opts *opts,
const struct spdk_nvme_transport_id *trid,
void *devhandle)
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
const struct spdk_nvme_ctrlr_opts *opts,
void *devhandle)
{
return NULL;
}