From d7bac36be47851239295d8ac884b822cc8b321fd Mon Sep 17 00:00:00 2001 From: Greg Tucker Date: Thu, 20 May 2021 11:48:43 -0700 Subject: [PATCH] crc: Fix warning in perf test from uninitialized tmp ptr Both gcc and clang are showing a warning on this despite the buffer always being set before use. Change-Id: I0e8f6b9e3451efe69e49814abc883d49b04f2666 Signed-off-by: Greg Tucker --- crc/crc16_t10dif_op_perf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crc/crc16_t10dif_op_perf.c b/crc/crc16_t10dif_op_perf.c index 9b91ef3..ae268f9 100644 --- a/crc/crc16_t10dif_op_perf.c +++ b/crc/crc16_t10dif_op_perf.c @@ -64,8 +64,9 @@ struct blk_ext { uint16_t crc; }; -void crc16_t10dif_copy_perf(struct blk *blks, struct blk *blkp, struct blk_ext *blks_ext, - struct blk_ext *blkp_ext, uint16_t * crc) +static void crc16_t10dif_copy_perf(struct blk *blks, struct blk *blkp, + struct blk_ext *blks_ext, struct blk_ext *blkp_ext, + uint16_t * crc) { int i; for (i = 0, blkp = blks, blkp_ext = blks_ext; i < NBLOCKS; i++) { @@ -80,8 +81,8 @@ void crc16_t10dif_copy_perf(struct blk *blks, struct blk *blkp, struct blk_ext * int main(int argc, char *argv[]) { uint16_t crc; - struct blk *blks, *blkp; - struct blk_ext *blks_ext, *blkp_ext; + struct blk *blks = NULL, *blkp = NULL; + struct blk_ext *blks_ext = NULL, *blkp_ext = NULL; struct perf start; printf("crc16_t10dif_streaming_insert_perf:\n");