Skip to content

Commit d31a688

Browse files
Martin Belangerigaw
authored andcommitted
nvmf: clean up discovery args struct initialization
Replace literal zero initializers with the proper named constants: .result = 0 -> removed (zero is the default for unspecified fields) .lsp = 0 -> .lsp = NVMF_LOG_DISC_LSP_NONE Also add the missing .timeout = NVME_DEFAULT_IOCTL_TIMEOUT in _nvmf_discovery() to be consistent with nbft_discovery(). Signed-off-by: Martin Belanger <[email protected]>
1 parent 1c9a73c commit d31a688

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,8 +1989,8 @@ static int _nvmf_discovery(struct libnvme_global_ctx *ctx,
19891989
.c = c,
19901990
.args_size = sizeof(args),
19911991
.max_retries = fctx->default_max_discovery_retries,
1992-
.result = 0,
1993-
.lsp = 0,
1992+
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
1993+
.lsp = NVMF_LOG_DISC_LSP_NONE,
19941994
};
19951995

19961996
err = nvmf_get_discovery_wargs(&args, &log);
@@ -2672,9 +2672,8 @@ static int nbft_discovery(struct libnvme_global_ctx *ctx,
26722672
.c = c,
26732673
.args_size = sizeof(args),
26742674
.max_retries = 10 /* MAX_DISC_RETRIES */,
2675-
.result = 0,
26762675
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
2677-
.lsp = 0,
2676+
.lsp = NVMF_LOG_DISC_LSP_NONE,
26782677
};
26792678

26802679
ret = nvmf_get_discovery_wargs(&args, &log);

0 commit comments

Comments
 (0)