Commit ff3d53f7 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

nvmf_tgt: optimize the value assignment of g_num_poll_groups



We do not need the for loop.

Change-Id: Icd4cd768f8c7d8a8b996b19e4d9369e76ed1dcdb
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/399790


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1f9da54e
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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));