Message ID | 20200730141245.21739-2-philmd@redhat.com |
---|---|
State | New |
Headers | show |
Series | util/pagesize: Make qemu_real_host_page_size of type size_t | expand |
On Thu, Jul 30, 2020 at 04:12:44PM +0200, Philippe Mathieu-Daudé wrote: > QEMU_VMALLOC_ALIGN is sometimes expanded to signed type, > other times to unsigned. Unify using unsigned. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> > --- > include/qemu/osdep.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h > index 20872e793e..085df8d508 100644 > --- a/include/qemu/osdep.h > +++ b/include/qemu/osdep.h > @@ -454,10 +454,10 @@ void qemu_anon_ram_free(void *ptr, size_t size); > /* Use 2 MiB alignment so transparent hugepages can be used by KVM. > Valgrind does not support alignments larger than 1 MiB, > therefore we need special code which handles running on Valgrind. */ > -# define QEMU_VMALLOC_ALIGN (512 * 4096) > +# define QEMU_VMALLOC_ALIGN (512 * 4096UL) > #elif defined(__linux__) && defined(__s390x__) > /* Use 1 MiB (segment size) alignment so gmap can be used by KVM. */ > -# define QEMU_VMALLOC_ALIGN (256 * 4096) > +# define QEMU_VMALLOC_ALIGN (256 * 4096UL) > #elif defined(__linux__) && defined(__sparc__) > #include <sys/shm.h> > # define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size, SHMLBA)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 20872e793e..085df8d508 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -454,10 +454,10 @@ void qemu_anon_ram_free(void *ptr, size_t size); /* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB, therefore we need special code which handles running on Valgrind. */ -# define QEMU_VMALLOC_ALIGN (512 * 4096) +# define QEMU_VMALLOC_ALIGN (512 * 4096UL) #elif defined(__linux__) && defined(__s390x__) /* Use 1 MiB (segment size) alignment so gmap can be used by KVM. */ -# define QEMU_VMALLOC_ALIGN (256 * 4096) +# define QEMU_VMALLOC_ALIGN (256 * 4096UL) #elif defined(__linux__) && defined(__sparc__) #include <sys/shm.h> # define QEMU_VMALLOC_ALIGN MAX(qemu_real_host_page_size, SHMLBA)
QEMU_VMALLOC_ALIGN is sometimes expanded to signed type, other times to unsigned. Unify using unsigned. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- include/qemu/osdep.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)