From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 89CA12B94 for ; Mon, 19 Nov 2018 14:53:08 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2018 05:53:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,252,1539673200"; d="scan'208";a="281201973" Received: from silpixa00399501.ir.intel.com ([10.237.223.69]) by fmsmga005.fm.intel.com with ESMTP; 19 Nov 2018 05:53:06 -0800 From: Lee Daly To: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com Cc: dev@dpdk.org, Lee Daly Date: Mon, 19 Nov 2018 13:52:53 +0000 Message-Id: <1542635573-85083-1-git-send-email-lee.daly@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] test/compress: improve debug trace setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 13:53:09 -0000 This removes the magic number from the assignment of the engine variable, which is used in the debug trace. Signed-off-by: Lee Daly --- test/test/test_compressdev.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c index b9748ce..a53e946 100644 --- a/test/test/test_compressdev.c +++ b/test/test/test_compressdev.c @@ -881,11 +881,9 @@ test_deflate_comp_decomp(const char * const test_bufs[], &compress_xforms[xform_idx]->compress; enum rte_comp_huffman huffman_type = compress_xform->deflate.huffman; - char engine[22]; - if (zlib_dir == ZLIB_COMPRESS || zlib_dir == ZLIB_ALL) - strlcpy(engine, "zlib (direct, no pmd)", 22); - else - strlcpy(engine, "pmd", 22); + char engine[] = "zlib (directly, not PMD)"; + if (zlib_dir != ZLIB_COMPRESS || zlib_dir != ZLIB_ALL) + strlcpy(engine, "PMD", sizeof(engine)); RTE_LOG(DEBUG, USER1, "Buffer %u compressed by %s from %u to" " %u bytes (level = %d, huffman = %s)\n", @@ -1092,11 +1090,9 @@ test_deflate_comp_decomp(const char * const test_bufs[], for (i = 0; i < num_bufs; i++) { priv_data = (struct priv_op_data *)(ops_processed[i] + 1); - char engine[22]; - if (zlib_dir == ZLIB_DECOMPRESS || zlib_dir == ZLIB_ALL) - strlcpy(engine, "zlib (direct, no pmd)", 22); - else - strlcpy(engine, "pmd", 22); + char engine[] = "zlib, (directly, no PMD)"; + if (zlib_dir != ZLIB_DECOMPRESS || zlib_dir != ZLIB_ALL) + strlcpy(engine, "pmd", sizeof(engine)); RTE_LOG(DEBUG, USER1, "Buffer %u decompressed by %s from %u to %u bytes\n", buf_idx[priv_data->orig_idx], engine, -- 2.7.4