diff options
author | Steven <sluong@cisco.com> | 2018-03-26 21:52:11 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-27 16:03:59 +0000 |
commit | 18c0f229cec4695cf77a0e3a9033d2ff0d1e085a (patch) | |
tree | 625838d9ef41b98d258bb2bf31ec04b58ade8dc2 /src/vnet/bonding/node.h | |
parent | ed76ee24dfe76fb9400470a4efb3871acd37cad9 (diff) |
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 <sluong@cisco.com>
Diffstat (limited to 'src/vnet/bonding/node.h')
-rw-r--r-- | src/vnet/bonding/node.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |