From 67fa1a7bafb1989a5e03719e5b1644ddd3f0e2aa Mon Sep 17 00:00:00 2001 From: Xiaodong Liu Date: Wed, 2 Nov 2016 19:48:25 -0400 Subject: [PATCH] crc32: add memset to performance cases Change-Id: Ifc99a26d842fbf6963c259b6c82a1e0a312e081f Signed-off-by: Xiaodong Liu --- crc/crc16_t10dif_perf.c | 1 + crc/crc32_ieee_perf.c | 1 + crc/crc32_iscsi_perf.c | 1 + 3 files changed, 3 insertions(+) diff --git a/crc/crc16_t10dif_perf.c b/crc/crc16_t10dif_perf.c index 5576e6d..34f1ddb 100644 --- a/crc/crc16_t10dif_perf.c +++ b/crc/crc16_t10dif_perf.c @@ -72,6 +72,7 @@ int main(int argc, char *argv[]) printf("Start timed tests\n"); fflush(0); + memset(buf, 0, TEST_LEN); crc = crc16_t10dif(TEST_SEED, buf, TEST_LEN); perf_start(&start); for (i = 0; i < TEST_LOOPS; i++) { diff --git a/crc/crc32_ieee_perf.c b/crc/crc32_ieee_perf.c index 0a7559c..c6c7495 100644 --- a/crc/crc32_ieee_perf.c +++ b/crc/crc32_ieee_perf.c @@ -72,6 +72,7 @@ int main(int argc, char *argv[]) printf("Start timed tests\n"); fflush(0); + memset(buf, 0, TEST_LEN); crc = crc32_ieee(TEST_SEED, buf, TEST_LEN); perf_start(&start); for (i = 0; i < TEST_LOOPS; i++) { diff --git a/crc/crc32_iscsi_perf.c b/crc/crc32_iscsi_perf.c index ddcb2b2..2770099 100644 --- a/crc/crc32_iscsi_perf.c +++ b/crc/crc32_iscsi_perf.c @@ -72,6 +72,7 @@ int main(int argc, char *argv[]) printf("Start timed tests\n"); fflush(0); + memset(buf, 0, TEST_LEN); crc = crc32_iscsi(buf, TEST_LEN, TEST_SEED); perf_start(&start); for (i = 0; i < TEST_LOOPS; i++) {