aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Shearman <robertshearman@gmail.com>2021-02-26 11:25:04 +0000
committerDamjan Marion <dmarion@me.com>2021-03-05 10:18:32 +0000
commit3a9bd7608f74594ab6ebc2fb20786bceaca72dea (patch)
tree30d9352c76faf6aae819ac4be99fddb4859e7045 /src
parentb72d0d2541d9ed10d2ead07ec71ae3bd6aec9775 (diff)
marvell: check return value of vlib_trace_buffer
Check the value of vlib_trace_buffer in mrvl_pp2_input_trace to fix a compiler error for an unused result of the function. Type: fix Fixes: 9a3973e3a36bfd4dd8dbffe130a92649fc1b73d3 Signed-off-by: Robert Shearman <robertshearman@gmail.com> Change-Id: Ib005ae662885ed8ef902607037b843a524789a19
Diffstat (limited to 'src')
-rw-r--r--src/plugins/marvell/pp2/input.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/marvell/pp2/input.c b/src/plugins/marvell/pp2/input.c
index 0c51d7d8ff6..202572dc152 100644
--- a/src/plugins/marvell/pp2/input.c
+++ b/src/plugins/marvell/pp2/input.c
@@ -59,14 +59,16 @@ mrvl_pp2_input_trace (vlib_main_t * vm, vlib_node_runtime_t * node, u32 next0,
vlib_buffer_t * b0, uword * n_trace,
mrvl_pp2_if_t * ppif, struct pp2_ppio_desc *d)
{
- mrvl_pp2_input_trace_t *tr;
- vlib_trace_buffer (vm, node, next0, b0,
- /* follow_chain */ 0);
- vlib_set_trace_count (vm, node, --(*n_trace));
- tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
- tr->next_index = next0;
- tr->hw_if_index = ppif->hw_if_index;
- clib_memcpy_fast (&tr->desc, d, sizeof (struct pp2_ppio_desc));
+ if (PREDICT_TRUE (
+ vlib_trace_buffer (vm, node, next0, b0, /* follow_chain */ 0)))
+ {
+ mrvl_pp2_input_trace_t *tr;
+ vlib_set_trace_count (vm, node, --(*n_trace));
+ tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
+ tr->next_index = next0;
+ tr->hw_if_index = ppif->hw_if_index;
+ clib_memcpy_fast (&tr->desc, d, sizeof (struct pp2_ppio_desc));
+ }
}
static_always_inline u16