nvmf_tgt: optimize the value assignment of g_num_poll_groups
We do not need the for loop. Change-Id: Icd4cd768f8c7d8a8b996b19e4d9369e76ed1dcdb Signed-off-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-on: https://review.gerrithub.io/399790 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
1f9da54e9c
commit
ff3d53f74e
@ -233,14 +233,10 @@ nvmf_tgt_advance_state(void *arg1, void *arg2)
|
||||
|
||||
switch (g_tgt.state) {
|
||||
case NVMF_TGT_INIT_NONE: {
|
||||
uint32_t core;
|
||||
|
||||
g_tgt.state = NVMF_TGT_INIT_PARSE_CONFIG;
|
||||
|
||||
/* Find the maximum core number */
|
||||
SPDK_ENV_FOREACH_CORE(core) {
|
||||
g_num_poll_groups = spdk_max(g_num_poll_groups, core + 1);
|
||||
}
|
||||
g_num_poll_groups = spdk_env_get_last_core() + 1;
|
||||
assert(g_num_poll_groups > 0);
|
||||
|
||||
g_poll_groups = calloc(g_num_poll_groups, sizeof(*g_poll_groups));
|
||||
|
Loading…
Reference in New Issue
Block a user