From ba20950a539d0b71a20f8a1199cbf759de92e854 Mon Sep 17 00:00:00 2001 From: Marcin Spiewak Date: Tue, 21 Feb 2023 16:38:06 +0000 Subject: [PATCH] lib/idxd: Fixed compilation issue (gcc 12.2.1) Added initialization of the prev_crc variable to avoid compilation error: idxd.c: In function ?spdk_idxd_submit_copy_crc32c?: idxd.c:1138:51: error: ?prev_crc? may be used uninitialized [-Werror=maybe-uninitialized] 1138 | desc->crc32c.addr = prev_crc; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~ idxd.c:1081:18: note: ?prev_crc? was declared here 1081 | uint64_t prev_crc; | ^~~~~~~~ Change-Id: I6b93d5d85b52e20f8a2c313c41b740f66eebe1c7 Signed-off-by: Marcin Spiewak Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16900 Reviewed-by: Tomasz Zawadzki Reviewed-by: Konrad Sztyber Reviewed-by: Aleksey Marchuk Tested-by: SPDK CI Jenkins --- lib/idxd/idxd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index c633e708c..430f6dcba 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -983,7 +983,7 @@ spdk_idxd_submit_crc32c(struct spdk_idxd_io_channel *chan, uint64_t len, seg_len; void *src; size_t i; - uint64_t prev_crc; + uint64_t prev_crc = 0; assert(chan != NULL); assert(siov != NULL); @@ -1078,7 +1078,7 @@ spdk_idxd_submit_copy_crc32c(struct spdk_idxd_io_channel *chan, uint64_t len, seg_len; struct spdk_ioviter iter; struct idxd_vtophys_iter vtophys_iter; - uint64_t prev_crc; + uint64_t prev_crc = 0; assert(chan != NULL); assert(diov != NULL);