From 9c8566f54872a2cff2b453438f9590e4c6582654 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 27 Sep 2014 14:13:58 -0600 Subject: [PATCH] crc/test: if the checksum needs a _final(), do it in the loop Signed-off-by: Jens Axboe --- crc/test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crc/test.c b/crc/test.c index 39ffac0b..6453a72b 100644 --- a/crc/test.c +++ b/crc/test.c @@ -55,10 +55,10 @@ static void t_md5(struct test_type *t, void *buf, size_t size) fio_md5_init(&ctx); - for (i = 0; i < NR_CHUNKS; i++) + for (i = 0; i < NR_CHUNKS; i++) { fio_md5_update(&ctx, buf, size); - - fio_md5_final(&ctx); + fio_md5_final(&ctx); + } } static void t_crc64(struct test_type *t, void *buf, size_t size) @@ -121,10 +121,10 @@ static void t_sha256(struct test_type *t, void *buf, size_t size) fio_sha256_init(&ctx); - for (i = 0; i < NR_CHUNKS; i++) + for (i = 0; i < NR_CHUNKS; i++) { fio_sha256_update(&ctx, buf, size); - - fio_sha256_final(&ctx); + fio_sha256_final(&ctx); + } } static void t_sha512(struct test_type *t, void *buf, size_t size) -- 2.25.1