[v2] app/mldev: fix code formatting and typos

Message ID 20230423045832.22640-1-syalavarthi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] app/mldev: fix code formatting and typos |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Srikanth Yalavarthi April 23, 2023, 4:58 a.m. UTC
  Updated ML application source files to have uniform code formatting
style across. Remove extra blank lines. Fix typos in application help.

Fixes: 8cb22a545447 ("app/mldev: fix debug build")
Fixes: da6793390596 ("app/mldev: support inference validation")
Fixes: c0e871657d6a ("app/mldev: support queue pairs and size")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 app/test-mldev/ml_options.c            |  4 +--
 app/test-mldev/test_inference_common.c | 36 +++++++++++++-------------
 2 files changed, 20 insertions(+), 20 deletions(-)
  

Comments

Thomas Monjalon July 6, 2023, 4:42 p.m. UTC | #1
23/04/2023 06:58, Srikanth Yalavarthi:
> Updated ML application source files to have uniform code formatting
> style across. Remove extra blank lines. Fix typos in application help.
> 
> Fixes: 8cb22a545447 ("app/mldev: fix debug build")
> Fixes: da6793390596 ("app/mldev: support inference validation")
> Fixes: c0e871657d6a ("app/mldev: support queue pairs and size")
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>

Applied, thanks.
  

Patch

diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c
index 2efcc3532c..e2f3c4dec8 100644
--- a/app/test-mldev/ml_options.c
+++ b/app/test-mldev/ml_options.c
@@ -200,7 +200,7 @@  ml_dump_test_options(const char *testname)
 {
 	if (strcmp(testname, "device_ops") == 0) {
 		printf("\t\t--queue_pairs      : number of queue pairs to create\n"
-		       "\t\t--queue_size       : size fo queue-pair\n");
+		       "\t\t--queue_size       : size of queue-pair\n");
 		printf("\n");
 	}
 
@@ -215,7 +215,7 @@  ml_dump_test_options(const char *testname)
 		       "\t\t--repetitions      : number of inference repetitions\n"
 		       "\t\t--burst_size       : inference burst size\n"
 		       "\t\t--queue_pairs      : number of queue pairs to create\n"
-		       "\t\t--queue_size       : size fo queue-pair\n"
+		       "\t\t--queue_size       : size of queue-pair\n"
 		       "\t\t--batches          : number of batches of input\n"
 		       "\t\t--tolerance        : maximum tolerance (%%) for output validation\n"
 		       "\t\t--stats            : enable reporting performance statistics\n");
diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c
index bf7e6bbe10..29c18bbc85 100644
--- a/app/test-mldev/test_inference_common.c
+++ b/app/test-mldev/test_inference_common.c
@@ -20,23 +20,23 @@ 
 
 #define ML_TEST_READ_TYPE(buffer, type) (*((type *)buffer))
 
-#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance)                                         \
+#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance) \
 	(((float)output - (float)reference) <= (((float)reference * tolerance) / 100.0))
 
-#define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err)                                             \
-	do {                                                                                       \
-		FILE *fp = fopen(name, "w+");                                                      \
-		if (fp == NULL) {                                                                  \
-			ml_err("Unable to create file: %s, error: %s", name, strerror(errno));     \
-			err = true;                                                                \
-		} else {                                                                           \
-			if (fwrite(buffer, 1, size, fp) != size) {                                 \
-				ml_err("Error writing output, file: %s, error: %s", name,          \
-				       strerror(errno));                                           \
-				err = true;                                                        \
-			}                                                                          \
-			fclose(fp);                                                                \
-		}                                                                                  \
+#define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err) \
+	do { \
+		FILE *fp = fopen(name, "w+"); \
+		if (fp == NULL) { \
+			ml_err("Unable to create file: %s, error: %s", name, strerror(errno)); \
+			err = true; \
+		} else { \
+			if (fwrite(buffer, 1, size, fp) != size) { \
+				ml_err("Error writing output, file: %s, error: %s", name, \
+				       strerror(errno)); \
+				err = true; \
+			} \
+			fclose(fp); \
+		} \
 	} while (0)
 
 static void
@@ -951,7 +951,7 @@  ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
 	if (t->cmn.opt->debug) {
 		/* dump quantized output buffer */
 		if (asprintf(&dump_path, "%s.q.%u", t->cmn.opt->filelist[req->fid].output,
-				obj_idx) == -1)
+			     obj_idx) == -1)
 			return;
 		ML_OPEN_WRITE_GET_ERR(dump_path, req->output, model->out_qsize, error);
 		free(dump_path);
@@ -959,8 +959,8 @@  ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
 			return;
 
 		/* dump dequantized output buffer */
-		if (asprintf(&dump_path, "%s.%u", t->cmn.opt->filelist[req->fid].output,
-				obj_idx) == -1)
+		if (asprintf(&dump_path, "%s.%u", t->cmn.opt->filelist[req->fid].output, obj_idx) ==
+		    -1)
 			return;
 		ML_OPEN_WRITE_GET_ERR(dump_path, model->output, model->out_dsize, error);
 		free(dump_path);