From 1b575d831d4234b84a3c15df423710bc4fc65e88 Mon Sep 17 00:00:00 2001 From: "Szulik, Maciej" Date: Mon, 26 Sep 2022 14:58:07 +0200 Subject: [PATCH] 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 Change-Id: I080b20a6008643ae78c8e3a6c2d183193ef6c1bf Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14674 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Aleksey Marchuk Reviewed-by: Jacek Kalwas Community-CI: Mellanox Build Bot --- lib/nvmf/ctrlr_bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvmf/ctrlr_bdev.c b/lib/nvmf/ctrlr_bdev.c index 2d7c606d6..0474d579f 100644 --- a/lib/nvmf/ctrlr_bdev.c +++ b/lib/nvmf/ctrlr_bdev.c @@ -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 iovec *iov; - int iovcnt; + int iovcnt = 0; if (spdk_unlikely(!success)) { int sc = 0, sct = 0;