]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
nbd-client: Use correct macro parenthesization
authorEric Blake <eblake@redhat.com>
Mon, 18 Sep 2017 21:46:49 +0000 (16:46 -0500)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 26 Sep 2017 06:11:22 +0000 (09:11 +0300)
If 'bs' is a complex expression, we were only casting the front half
rather than the full expression.  Luckily, none of the callers were
passing bad arguments, but it's better to be robust up front.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/nbd-client.c

index ee7f758e68c17db1cafe1051ff76237e69c710d3..cc05e73c2dd8efa9b28fcd99ed6fc456098e31ff 100644 (file)
@@ -31,8 +31,8 @@
 #include "qapi/error.h"
 #include "nbd-client.h"
 
-#define HANDLE_TO_INDEX(bs, handle) ((handle) ^ ((uint64_t)(intptr_t)bs))
-#define INDEX_TO_HANDLE(bs, index)  ((index)  ^ ((uint64_t)(intptr_t)bs))
+#define HANDLE_TO_INDEX(bs, handle) ((handle) ^ (uint64_t)(intptr_t)(bs))
+#define INDEX_TO_HANDLE(bs, index)  ((index)  ^ (uint64_t)(intptr_t)(bs))
 
 static void nbd_recv_coroutines_wake_all(NBDClientSession *s)
 {