pipeline: adjust error code for internal function

Message ID 20210330101904.58023-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series pipeline: adjust error code for internal function |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Cristian Dumitrescu March 30, 2021, 10:19 a.m. UTC
  Adjusting the error code for the internal function instruction_config
to match the rest of the code which is returning a negative value on
error. Cosmetic change.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_pipeline/rte_swx_pipeline.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon April 20, 2021, 12:33 a.m. UTC | #1
30/03/2021 12:19, Cristian Dumitrescu:
> Adjusting the error code for the internal function instruction_config
> to match the rest of the code which is returning a negative value on
> error. Cosmetic change.
> 
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c
index 48ac250c1..f46f90c34 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.c
+++ b/lib/librte_pipeline/rte_swx_pipeline.c
@@ -8049,20 +8049,20 @@  instruction_config(struct rte_swx_pipeline *p,
 	/* Memory allocation. */
 	instr = calloc(n_instructions, sizeof(struct instruction));
 	if (!instr) {
-		err = ENOMEM;
+		err = -ENOMEM;
 		goto error;
 	}
 
 	data = calloc(n_instructions, sizeof(struct instruction_data));
 	if (!data) {
-		err = ENOMEM;
+		err = -ENOMEM;
 		goto error;
 	}
 
 	for (i = 0; i < n_instructions; i++) {
 		char *string = strdup(instructions[i]);
 		if (!string) {
-			err = ENOMEM;
+			err = -ENOMEM;
 			goto error;
 		}