From: Eric Blake Date: Mon, 18 Sep 2017 21:46:49 +0000 (-0500) Subject: nbd-client: Use correct macro parenthesization X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=af5eeb2c3b691e13b55724e4b6d831cb054ffebe;p=qemu.git 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- diff --git a/block/nbd-client.c b/block/nbd-client.c index ee7f758e68..cc05e73c2d 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) {