lib/alloc.c: fix missing include
Subsystems (2)
Paolo Bonzini
maintainerPATCH 1/1 lib/alloc.c: fix missing include
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 <[email protected]>
--- lib/alloc.c | 1 + 1 file changed, 1 insertion(+)
lib/alloc.c +1 -0
@@ -1,5 +1,6 @@#include "alloc.h" #include "asm/page.h" +#include "bitops.h" void *malloc (size_t size) {
Signature · 1 line
2.26.2
Quoted 11 lines · Paolo Bonzini
Include
bitops.hto getBITS_PER_LONGand avoid errors such as
lib/alloc.c: In functionmult_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 <[email protected]>
Reviewed-by Jim Mattson <[email protected]>