Commit 240fa8eb authored by Marcin Spiewak's avatar Marcin Spiewak Committed by Jim Harris
Browse files

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;
      |                  ^~~~~~~~

Signed-off-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16900

 (master)

(cherry picked from commit ba20950a)
Change-Id: I6b93d5d85b52e20f8a2c313c41b740f66eebe1c7
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17695


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
parent c42b8900
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);