From 18c0f229cec4695cf77a0e3a9033d2ff0d1e085a Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 26 Mar 2018 21:52:11 -0700 Subject: bond: coverity woes coverity complains about statements in function A function A { x % vec_len (y) } because vec_len (y) is a macro and may return 0 if the pointer y is null. But coverity fails to realize the same statement vec_len (y) was already invoked and checked in the caller of function A and punt if vec_len (y) is 0. We can fix the coverity warning and shave off a few cpu cycles by caching the result of vec_len (y) and pass it around to avoid calling vec_len (y) again in multiple places. Change-Id: I095166373abd3af3859646f860ee97c52f12fb50 Signed-off-by: Steven --- src/vnet/bonding/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet/bonding/node.h') diff --git a/src/vnet/bonding/node.h b/src/vnet/bonding/node.h index ae811a12a64..3a01abe2226 100644 --- a/src/vnet/bonding/node.h +++ b/src/vnet/bonding/node.h @@ -315,7 +315,7 @@ typedef struct typedef u32 (*load_balance_func) (vlib_main_t * vm, vlib_node_runtime_t * node, bond_if_t * bif, - vlib_buffer_t * b0); + vlib_buffer_t * b0, uword slave_count); typedef struct { -- cgit 1.2.3-korg