[v8,7/7] app/test-compress-perf: 'magic numbers' removed

Message ID 20190708181619.8028-8-arturx.trybula@intel.com
State Accepted
Delegated to: akhil goyal
Headers show
Series
  • add multiple cores feature to test-compress-perf
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Trybula, ArturX July 8, 2019, 6:16 p.m.
This patch fixes some minor problems like 'magic numbers',
spelling mistakes, enumes naming.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
---
 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(-)

Comments

Trahe, Fiona July 15, 2019, 10:03 a.m. | #1
> -----Original Message-----
> From: Trybula, ArturX
> Sent: Monday, July 8, 2019 7:16 PM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; shallyv@marvell.com; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>; Trybula, ArturX <arturx.trybula@intel.com>; akhil.goyal@nxp.com
> Subject: [PATCH v8 7/7] app/test-compress-perf: 'magic numbers' removed
> 
> This patch fixes some minor problems like 'magic numbers',
> spelling mistakes, enumes naming.
> 
> Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Patch

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 <rte_log.h>
 #include <rte_compressdev.h>
 
+#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 =