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

[Minios-devel] [UNIKRAFT PATCH 2/2] lib/uknetdev: Fix compliation warning about signed/unsigned comparision



This fixes the compliation warning when compiling libuknetdev

/root/hj/UK/unikraft/lib/uknetdev/netbuf.c: In function
'uk_netbuf_alloc_buf':
/root/hj/UK/unikraft/lib/uknetdev/netbuf.c:120:35: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(UINT16_MAX - headroom > NETBUF_ADDR_ALIGNMENT)) {
                                   ^
/root/hj/UK/unikraft/include/uk/arch/lcpu.h:48:43: note: in definition
of macro 'likely'
 #define likely(x)   (__builtin_expect((!!(x)), 1))
                                           ^
Signed-off-by: Jia He <justin.he@xxxxxxx>
---
 lib/uknetdev/netbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/uknetdev/netbuf.c b/lib/uknetdev/netbuf.c
index 96a5f68..108bd36 100644
--- a/lib/uknetdev/netbuf.c
+++ b/lib/uknetdev/netbuf.c
@@ -36,7 +36,7 @@
 #include <uk/print.h>
 
 /* Used to align netbuf's priv and data areas to `long long` data type */
-#define NETBUF_ADDR_ALIGNMENT (sizeof(long long))
+#define NETBUF_ADDR_ALIGNMENT (int)(sizeof(long long))
 #define NETBUF_ADDR_ALIGN_UP(x) ALIGN_UP((x), NETBUF_ADDR_ALIGNMENT)
 
 void uk_netbuf_init_indir(struct uk_netbuf *m,
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.