pipeline: remove unreachable branch
[dpdk.git] / lib / pipeline / rte_swx_pipeline.c
index 5e089fb..2145ca0 100644 (file)
@@ -4539,8 +4539,6 @@ instr_meter_translate(struct rte_swx_pipeline *p,
                instr->meter.color_out.struct_id = (uint8_t)color_out_struct_id;
                instr->meter.color_out.n_bits = fcout->n_bits;
                instr->meter.color_out.offset = fcout->offset / 8;
-
-               return 0;
        }
 
        /* index = HMEFT, length = HMEFT, color_in = I, color_out = MEF. */
@@ -4575,8 +4573,6 @@ instr_meter_translate(struct rte_swx_pipeline *p,
                instr->meter.color_out.struct_id = (uint8_t)color_out_struct_id;
                instr->meter.color_out.n_bits = fcout->n_bits;
                instr->meter.color_out.offset = fcout->offset / 8;
-
-               return 0;
        }
 
        /* index = I, length = HMEFT, color_in = MEFT, color_out = MEF. */
@@ -4607,8 +4603,6 @@ instr_meter_translate(struct rte_swx_pipeline *p,
                instr->meter.color_out.struct_id = (uint8_t)color_out_struct_id;
                instr->meter.color_out.n_bits = fcout->n_bits;
                instr->meter.color_out.offset = fcout->offset / 8;
-
-               return 0;
        }
 
        /* index = I, length = HMEFT, color_in = I, color_out = MEF. */
@@ -4638,11 +4632,9 @@ instr_meter_translate(struct rte_swx_pipeline *p,
                instr->meter.color_out.struct_id = (uint8_t)color_out_struct_id;
                instr->meter.color_out.n_bits = fcout->n_bits;
                instr->meter.color_out.offset = fcout->offset / 8;
-
-               return 0;
        }
 
-       CHECK(0, EINVAL);
+       return 0;
 }
 
 static inline void
@@ -5937,7 +5929,7 @@ instr_translate(struct rte_swx_pipeline *p,
                                              instr,
                                              data);
 
-       CHECK(0, EINVAL);
+       return -EINVAL;
 }
 
 static struct instruction_data *
@@ -7387,7 +7379,8 @@ rte_swx_pipeline_table_config(struct rte_swx_pipeline *p,
 
        /* Memory allocation. */
        t = calloc(1, sizeof(struct table));
-       CHECK(t, ENOMEM);
+       if (!t)
+               goto nomem;
 
        t->fields = calloc(params->n_fields, sizeof(struct match_field));
        if (!t->fields)