|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] bitmap: fix n__ signess
All callers of the bitmap_switch macro (which are all within bitmap.h)
pass an int as first parameter. Do not assign it to an unsigned int
potentially introducing errors.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
We could also have gone the other way and change all the callers and the
callers' callers to use an unsigned int instead, but I went for the path
of least resistance.
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index 3caf92c76d..7caec098d7 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -101,7 +101,7 @@ extern int bitmap_allocate_region(unsigned long *bitmap,
int pos, int order);
#define bitmap_bytes(nbits) (BITS_TO_LONGS(nbits) * sizeof(unsigned long))
#define bitmap_switch(nbits, zero, small, large) \
- unsigned int n__ = (nbits); \
+ int n__ = (nbits); \
if (__builtin_constant_p(nbits) && !n__) { \
zero; \
} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |