From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A005AA00E6 for ; Mon, 8 Jul 2019 20:25:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E78A71B9ED; Mon, 8 Jul 2019 20:24:44 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 83CCC1B9A0 for ; Mon, 8 Jul 2019 20:24:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 11:24:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,466,1557212400"; d="scan'208";a="192402101" Received: from atrybulx-mobl.ger.corp.intel.com (HELO build-VirtualBox.isw.intel.com) ([10.103.104.106]) by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2019 11:24:32 -0700 From: Artur Trybula To: dev@dpdk.org, fiona.trahe@intel.com, shallyv@marvell.com, adamx.dybkowski@intel.com, arturx.trybula@intel.com, akhil.goyal@nxp.com Date: Mon, 8 Jul 2019 20:16:19 +0200 Message-Id: <20190708181619.8028-8-arturx.trybula@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708181619.8028-1-arturx.trybula@intel.com> References: <1562325340-3891-2-git-send-email-fiona.trahe@intel.com> <20190708181619.8028-1-arturx.trybula@intel.com> Subject: [dpdk-dev] [PATCH v8 7/7] app/test-compress-perf: 'magic numbers' removed 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes some minor problems like 'magic numbers', spelling mistakes, enumes naming. Signed-off-by: Artur Trybula --- app/test-compress-perf/comp_perf_options.h | 10 ++++------ app/test-compress-perf/comp_perf_options_parse.c | 6 +++--- app/test-compress-perf/comp_perf_test_common.c | 7 ++++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h index 532fb964e..5a32ed3a6 100644 --- a/app/test-compress-perf/comp_perf_options.h +++ b/app/test-compress-perf/comp_perf_options.h @@ -5,8 +5,6 @@ #ifndef _COMP_PERF_OPS_ #define _COMP_PERF_OPS_ -#define MAX_DRIVER_NAME 64 -#define MAX_INPUT_FILE_NAME 64 #define MAX_LIST 32 #define MIN_COMPRESSED_BUF_SIZE 8 #define EXPANSE_RATIO 1.05 @@ -25,7 +23,7 @@ enum cleanup_st { ST_DURING_TEST }; -enum cperf_perf_test_type { +enum cperf_test_type { CPERF_TEST_TYPE_BENCHMARK, CPERF_TEST_TYPE_VERIFY }; @@ -45,9 +43,9 @@ struct range_list { }; struct comp_test_data { - char driver_name[64]; - char input_file[64]; - enum cperf_perf_test_type test; + char driver_name[RTE_DEV_NAME_MAX_LEN]; + char input_file[PATH_MAX]; + enum cperf_test_type test; uint8_t *input_data; size_t input_data_sz; diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c index 3d820197a..01e19eafb 100644 --- a/app/test-compress-perf/comp_perf_options_parse.c +++ b/app/test-compress-perf/comp_perf_options_parse.c @@ -99,7 +99,7 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg) return -1; } - test_data->test = (enum cperf_perf_test_type)id; + test_data->test = (enum cperf_test_type)id; return 0; } @@ -614,8 +614,8 @@ comp_perf_options_default(struct comp_test_data *test_data) test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC; test_data->test_op = COMPRESS_DECOMPRESS; test_data->window_sz = -1; - test_data->level_lst.min = 1; - test_data->level_lst.max = 9; + test_data->level_lst.min = RTE_COMP_LEVEL_MIN; + test_data->level_lst.max = RTE_COMP_LEVEL_MAX; test_data->level_lst.inc = 1; test_data->test = CPERF_TEST_TYPE_BENCHMARK; } diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c index dc9d0b0f4..472c76686 100644 --- a/app/test-compress-perf/comp_perf_test_common.c +++ b/app/test-compress-perf/comp_perf_test_common.c @@ -7,11 +7,12 @@ #include #include +#include "comp_perf.h" #include "comp_perf_options.h" -#include "comp_perf_test_verify.h" #include "comp_perf_test_benchmark.h" -#include "comp_perf.h" #include "comp_perf_test_common.h" +#include "comp_perf_test_verify.h" + #define DIV_CEIL(a, b) ((a) / (b) + ((a) % (b) != 0)) @@ -49,7 +50,7 @@ find_buf_size(uint32_t input_size) * power of 2 but also should be enough to store incompressible data */ - /* We're looking for nearest power of 2 buffer size, which is greather + /* We're looking for nearest power of 2 buffer size, which is greater * than input_size */ uint32_t size = -- 2.17.1