From 96e2d4407b1538d8df4e277ba33b85876589e198 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 14 Nov 2018 11:42:03 -0500 Subject: VPP-1474: fix 2x coverity warnings Change-Id: I441beaf3d7f57886580d7cce35ef592aa0fcca5f Signed-off-by: Dave Barach --- src/vppinfra/pmalloc.c | 2 +- src/vppinfra/time.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index e11d27ef77b..b707336bfbd 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -212,7 +212,7 @@ pmalloc_update_lookup_table (clib_pmalloc_main_t * pm, u32 first, u32 count) vec_validate_aligned (pm->lookup_table, vec_len (pm->pages) * elts_per_page - 1, CLIB_CACHE_LINE_BYTES); - p = first * elts_per_page; + p = (uword) first *elts_per_page; if (pm->flags & CLIB_PMALLOC_F_NO_PAGEMAP) { while (p < (uword) elts_per_page * count) diff --git a/src/vppinfra/time.c b/src/vppinfra/time.c index 2bba1daba12..dee50024975 100644 --- a/src/vppinfra/time.c +++ b/src/vppinfra/time.c @@ -120,7 +120,7 @@ clock_frequency_from_proc_filesystem (void) static f64 clock_frequency_from_sys_filesystem (void) { - f64 cpu_freq; + f64 cpu_freq = 0.0; int fd; unformat_input_t input; @@ -131,7 +131,7 @@ clock_frequency_from_sys_filesystem (void) goto done; unformat_init_clib_file (&input, fd); - unformat (&input, "%f", &cpu_freq); + (void) unformat (&input, "%f", &cpu_freq); cpu_freq *= 1e3; /* measured in kHz */ unformat_free (&input); close (fd); -- cgit 1.2.3-korg