[PATCH kvm-unit-tests] lib/alloc.c: fix missing include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Include bitops.h to get BITS_PER_LONG and avoid errors such as

lib/alloc.c: In function mult_overflow:
lib/alloc.c:24:9: error: right shift count >= width of type
[-Werror=shift-count-overflow]
   24 |  if ((a >> 32) && (b >> 32))
      |         ^~

Fixes: cde8415e1 ("lib/alloc.c: add overflow check for calloc")
Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 lib/alloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/alloc.c b/lib/alloc.c
index f4aa87a..6c89f98 100644
--- a/lib/alloc.c
+++ b/lib/alloc.c
@@ -1,5 +1,6 @@
 #include "alloc.h"
 #include "asm/page.h"
+#include "bitops.h"
 
 void *malloc(size_t size)
 {
-- 
2.26.2




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux