env_dpdk: make pci_env_init() return int
This allows it to return error codes. Have the init code check the return value and fail the init process when pci_env_init() returns error. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I7c8a4f9a6da6b3438ed09a881153b7a4ceef3a83 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14635 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
a25a834ae1
commit
52c674d23a
@ -27,7 +27,7 @@
|
||||
#define SHIFT_1GB 30 /* (1 << 30) == 1 GB */
|
||||
#define MASK_1GB ((1ULL << SHIFT_1GB) - 1)
|
||||
|
||||
void pci_env_init(void);
|
||||
int pci_env_init(void);
|
||||
void pci_env_reinit(void);
|
||||
void pci_env_fini(void);
|
||||
int mem_map_init(bool legacy_mem);
|
||||
|
@ -524,7 +524,11 @@ spdk_env_dpdk_post_init(bool legacy_mem)
|
||||
{
|
||||
int rc;
|
||||
|
||||
pci_env_init();
|
||||
rc = pci_env_init();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("pci_env_init() failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = mem_map_init(legacy_mem);
|
||||
if (rc < 0) {
|
||||
|
@ -296,7 +296,7 @@ _pci_env_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
pci_env_init(void)
|
||||
{
|
||||
struct spdk_pci_driver *driver;
|
||||
@ -306,6 +306,7 @@ pci_env_init(void)
|
||||
}
|
||||
|
||||
_pci_env_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user