From: Jens Axboe Date: Sat, 27 Sep 2014 20:13:58 +0000 (-0600) Subject: crc/test: if the checksum needs a _final(), do it in the loop X-Git-Tag: fio-2.1.13~22 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=9c8566f54872a2cff2b453438f9590e4c6582654 crc/test: if the checksum needs a _final(), do it in the loop Signed-off-by: Jens Axboe --- 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)