From 94c06a68de0fa98a0e80cd0120560b67e0e26f50 Mon Sep 17 00:00:00 2001 From: Hailiang Wang Date: Fri, 28 Jun 2019 10:33:46 +0800 Subject: [PATCH] test/dif_ut: fix a warning of iov_base garbage value Compilation Warning on fedora30. dif_ut.c:151:24: warning: The left operand of '==' is a garbage value return (iov->iov_base == iov_base && iov->iov_len == iov_len); ~~~~~~~~~~~~~ ^ This is related to issue #822. Change-Id: Ie050c65d3747c551e2c26e84d3879742eaf86fd8 Signed-off-by: Hailiang Wang Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459712 Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/unit/lib/util/dif.c/dif_ut.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/lib/util/dif.c/dif_ut.c b/test/unit/lib/util/dif.c/dif_ut.c index 3018308e4..3e4042548 100644 --- a/test/unit/lib/util/dif.c/dif_ut.c +++ b/test/unit/lib/util/dif.c/dif_ut.c @@ -1390,7 +1390,7 @@ set_md_interleave_iovs_test(void) { struct spdk_dif_ctx ctx = {}; struct spdk_dif_error err_blk = {}; - struct iovec iov1, iov2, dif_iovs[4]; + struct iovec iov1, iov2, dif_iovs[4] = {}; uint32_t dif_check_flags, data_len, read_len, data_offset, mapped_len = 0; uint8_t *buf1, *buf2; int rc; @@ -1519,7 +1519,7 @@ set_md_interleave_iovs_split_test(void) { struct spdk_dif_ctx ctx = {}; struct spdk_dif_error err_blk = {}; - struct iovec iovs1[7], iovs2[7], dif_iovs[8]; + struct iovec iovs1[7], iovs2[7], dif_iovs[8] = {}; uint32_t dif_check_flags, data_len, read_len, data_offset, mapped_len = 0; int rc, i; @@ -1722,7 +1722,7 @@ dif_generate_stream_test(void) static void set_md_interleave_iovs_alignment_test(void) { - struct iovec iovs[3], dif_iovs[5]; + struct iovec iovs[3], dif_iovs[5] = {}; uint32_t mapped_len = 0; int rc; struct spdk_dif_ctx ctx;