lib/nvmf: add explicit iovcnt init to silence LTO related warning

When Link Time Optimization is enabled, compiler can sometimes produce
additional warnings saying that some variables may be uninitialized.

To supress the warning it is enough to add explicit initialization
of the variable causing the issue, in this case 'iovcnt = 0'.

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I080b20a6008643ae78c8e3a6c2d183193ef6c1bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14674
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Szulik, Maciej 2022-09-26 14:58:07 +02:00 committed by Tomasz Zawadzki
parent 9b8939660a
commit 1b575d831d

View File

@ -761,7 +761,7 @@ nvmf_bdev_ctrlr_zcopy_start_complete(struct spdk_bdev_io *bdev_io, bool success,
{ {
struct spdk_nvmf_request *req = cb_arg; struct spdk_nvmf_request *req = cb_arg;
struct iovec *iov; struct iovec *iov;
int iovcnt; int iovcnt = 0;
if (spdk_unlikely(!success)) { if (spdk_unlikely(!success)) {
int sc = 0, sct = 0; int sc = 0, sct = 0;