vppinfra: Fix bihash coverity warning 27/28627/2
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Tue, 1 Sep 2020 07:35:31 +0000 (09:35 +0200)
committerDave Barach <openvpp@barachs.net>
Tue, 1 Sep 2020 11:19:34 +0000 (11:19 +0000)
Type: fix

Hitting a code not reachable when setting
BIHASH_KVP_AT_BUCKET_LEVEL = 1

Change-Id: I24d539df67ae7650a3b1969f5709a6f7366d786b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
src/vppinfra/bihash_template.h

index 85c5d65..d6aa3c9 100644 (file)
@@ -368,9 +368,9 @@ BV (clib_bihash_get_bucket) (BVT (clib_bihash) * h, u64 hash)
   offset = offset * (sizeof (BVT (clib_bihash_bucket))
                     + (BIHASH_KVP_PER_PAGE * sizeof (BVT (clib_bihash_kv))));
   return ((BVT (clib_bihash_bucket) *) (((u8 *) h->buckets) + offset));
-#endif
-
+#else
   return h->buckets + (hash & (h->nbuckets - 1));
+#endif
 }
 
 static inline int BV (clib_bihash_search_inline_with_hash)