From 971ca501b92284dfb71a3626726ef79bb6a65ea1 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Thu, 15 Aug 2024 14:44:53 +0300 Subject: [PATCH] mm/map/vm_region.c: Fix usage of void* arithmetics Fixes build error: map/vm_region.c: In function 'vm_map_region': map/vm_region.c:128:16: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] 128 | return vaddr + (MM_PGMASK & paddr); | ^ cc1: all warnings being treated as errors --- mm/map/vm_region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/map/vm_region.c b/mm/map/vm_region.c index 0c94c74de4..9029742c45 100644 --- a/mm/map/vm_region.c +++ b/mm/map/vm_region.c @@ -125,7 +125,7 @@ FAR void *vm_map_region(uintptr_t paddr, size_t size) } } - return vaddr + (MM_PGMASK & paddr); + return (FAR void *)((uintptr_t)vaddr + (MM_PGMASK & paddr)); error: if (i) /* undo alway mapped pages */