Message ID | 20200706164324.81123-2-imbrenda@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | More lib/alloc cleanup and a minor improvement | expand |
On Mon, Jul 6, 2020 at 9:43 AM Claudio Imbrenda <imbrenda@linux.ibm.com> wrote: > > Since size is of type size_t, size >> PAGE_SHIFT might still be too big > for a normal unsigned int. > > Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> > Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Jim Mattson <jmattson@google.com>
diff --git a/lib/vmalloc.c b/lib/vmalloc.c index 10f15af..9237a0f 100644 --- a/lib/vmalloc.c +++ b/lib/vmalloc.c @@ -40,7 +40,7 @@ void *alloc_vpage(void) void *vmap(phys_addr_t phys, size_t size) { void *mem, *p; - unsigned pages; + size_t pages; size = PAGE_ALIGN(size); pages = size / PAGE_SIZE; @@ -58,7 +58,7 @@ void *vmap(phys_addr_t phys, size_t size) static void *vm_memalign(size_t alignment, size_t size) { void *mem, *p; - unsigned pages; + size_t pages; assert(alignment <= PAGE_SIZE); size = PAGE_ALIGN(size);