summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-02-09 10:03:50 -0800
committerDamjan Marion <dmarion@me.com>2021-02-11 10:38:12 +0000
commitc25882c28e081bf6a2bd4e914ac85f6e4edbfc3d (patch)
treec985b99621706b325923e3d117ffacac59c4bd67 /src
parent8dc0d488e62323a6f2814a74130934f5ed2bf724 (diff)
vppinfra: fix membulk coverity warnings
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4830656ad852de62211e31574a0e0afb62d00f37
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/mem_bulk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vppinfra/mem_bulk.c b/src/vppinfra/mem_bulk.c
index 2f236b4785f..0ede1b36786 100644
--- a/src/vppinfra/mem_bulk.c
+++ b/src/vppinfra/mem_bulk.c
@@ -66,7 +66,7 @@ clib_mem_bulk_init (u32 elt_sz, u32 align, u32 min_elts_per_chunk)
b->elt_sz = round_pow2 (elt_sz, align);
b->chunk_hdr_sz = round_pow2 (sizeof (clib_mem_bulk_chunk_hdr_t), align);
b->elts_per_chunk = min_elts_per_chunk;
- sz = b->elts_per_chunk * b->elt_sz + b->chunk_hdr_sz;
+ sz = (uword) b->elts_per_chunk * b->elt_sz + b->chunk_hdr_sz;
b->chunk_align = max_pow2 (sz);
b->elts_per_chunk += (b->chunk_align - sz) / b->elt_sz;
return b;
@@ -220,7 +220,7 @@ format_clib_mem_bulk (u8 *s, va_list *args)
}
n_elts = n_chunks * b->elts_per_chunk;
- chunk_sz = b->chunk_hdr_sz + b->elts_per_chunk * b->elt_sz;
+ chunk_sz = b->chunk_hdr_sz + (uword) b->elts_per_chunk * b->elt_sz;
s = format (s, "%u bytes/elt, align %u, chunk-align %u, ", b->elt_sz,
b->align, b->chunk_align);