Updated ML application source files to have uniform code
formatting style across. Remove extra blank lines.

Fixes: 8cb22a545447 ("app/mldev: fix debug build")
Fixes: c9f073cdca95 ("mldev: remove unnecessary null checks")
Fixes: da6793390596 ("app/mldev: support inference validation")

Signed-off-by: Srikanth Yalavarthi <syalavar...@marvell.com>
---
 app/test-mldev/test_inference_common.c | 38 ++++++++++++--------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/app/test-mldev/test_inference_common.c 
b/app/test-mldev/test_inference_common.c
index 410e63bca4..f8960ae726 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
@@ -937,7 +937,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);
@@ -945,8 +945,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);
@@ -1077,7 +1077,6 @@ ml_inference_stats_get(struct ml_test *test, struct 
ml_options *opt)
 
        /* release buffers */
        rte_free(t->xstats_map);
-
        rte_free(t->xstats_values);
 
        /* print end-to-end stats */
@@ -1116,7 +1115,6 @@ ml_inference_stats_get(struct ml_test *test, struct 
ml_options *opt)
 
 error:
        rte_free(t->xstats_map);
-
        rte_free(t->xstats_values);
 
        return ret;
-- 
2.17.1

Reply via email to