summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/linux/mem.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-10-07 09:37:36 -0400
committerDamjan Marion <dmarion@me.com>2020-10-08 06:10:16 +0000
commit27c35e30569c3904e977e7f841b8bc56f16aeb9f (patch)
tree4f37824acc98769d14f6a4c6e6c613deed5b5f0e /src/vppinfra/linux/mem.c
parent6e366be38ff4f71d4ad5a24929519dc3c874ed36 (diff)
vppinfra: fix coverity warnings
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I654747d618cc4fe99b7774827303769fe43392ed
Diffstat (limited to 'src/vppinfra/linux/mem.c')
-rw-r--r--src/vppinfra/linux/mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index 22268eadb8e..f31b456308d 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -374,7 +374,7 @@ clib_mem_vm_map_hdr_t *
clib_mem_vm_get_next_map_hdr (clib_mem_vm_map_hdr_t * hdr)
{
clib_mem_main_t *mm = &clib_mem_main;
- uword sys_page_sz = 1 << mm->log2_page_sz;
+ uword sys_page_sz = 1ULL << mm->log2_page_sz;
clib_mem_vm_map_hdr_t *next;
if (hdr == 0)
{
@@ -396,7 +396,7 @@ clib_mem_vm_map_internal (void *base, clib_mem_page_sz_t log2_page_sz,
{
clib_mem_main_t *mm = &clib_mem_main;
clib_mem_vm_map_hdr_t *hdr;
- uword sys_page_sz = 1 << mm->log2_page_sz;
+ uword sys_page_sz = 1ULL << mm->log2_page_sz;
int mmap_flags = MAP_FIXED, is_huge = 0;
if (fd != -1)
@@ -436,7 +436,7 @@ clib_mem_vm_map_internal (void *base, clib_mem_page_sz_t log2_page_sz,
if (log2_page_sz == CLIB_MEM_PAGE_SZ_UNKNOWN)
return CLIB_MEM_VM_MAP_FAILED;
- size = round_pow2 (size, 1 << log2_page_sz);
+ size = round_pow2 (size, 1ULL << log2_page_sz);
base = (void *) clib_mem_vm_reserve ((uword) base, size, log2_page_sz);
@@ -492,7 +492,7 @@ int
clib_mem_vm_unmap (void *base)
{
clib_mem_main_t *mm = &clib_mem_main;
- uword size, sys_page_sz = 1 << mm->log2_page_sz;
+ uword size, sys_page_sz = 1ULL << mm->log2_page_sz;
clib_mem_vm_map_hdr_t *hdr = base - sys_page_sz;;
if (mprotect (hdr, sys_page_sz, PROT_READ | PROT_WRITE) != 0)