aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-09-18 16:46:49 -0500
committerEric Blake <eblake@redhat.com>2017-09-25 08:21:25 -0500
commitcfa3ad635c6d12f98049a7598e23305d233a4d73 (patch)
treef0adf7bcb7c104a5d5443b49393933513b4f7535
parent460b6c8e581aa06b86f59eebd9e52edfe7adf417 (diff)
downloadqemu-cfa3ad635c6d12f98049a7598e23305d233a4d73.zip
qemu-cfa3ad635c6d12f98049a7598e23305d233a4d73.tar.gz
qemu-cfa3ad635c6d12f98049a7598e23305d233a4d73.tar.bz2
nbd-client: Use correct macro parenthesization
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> Message-Id: <20170918214649.17550-1-eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--block/nbd-client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/nbd-client.c b/block/nbd-client.c
index ee7f758..cc05e73 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -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)
{