From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwb6-0007QY-G4 for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alwb5-0002ZL-NG for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:36 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:43275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwb5-0002Z5-Hy for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:35 -0400 From: Alex Bligh Date: Fri, 1 Apr 2016 11:46:30 +0100 Message-Id: <1459507590-1191-2-git-send-email-alex@alex.org.uk> In-Reply-To: <1459507590-1191-1-git-send-email-alex@alex.org.uk> References: <1459507590-1191-1-git-send-email-alex@alex.org.uk> Subject: [Qemu-devel] [PATCHv2 2/2] Correct definition of NBD_CMD_FLAG_FUA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Wouter Verhelst Cc: "nbd-general@lists.sourceforge.net" , "qemu-devel@nongnu.org" , Alex Bligh NBD_CMD_FLAG_FUA is defined as 1<<0 in the documentation, but 1<<16 in nbd.h. The code currently treats the command as a 32 bit quantity and masks this off. This is confusing. Until such time as the code is fixed up, make it obvious this isn't really bit 16. Signed-off-by: Alex Bligh --- nbd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nbd.h b/nbd.h index f2a32dd..732c605 100644 --- a/nbd.h +++ b/nbd.h @@ -38,7 +38,8 @@ enum { }; #define NBD_CMD_MASK_COMMAND 0x0000ffff -#define NBD_CMD_FLAG_FUA (1<<16) +#define NBD_CMD_SHIFT (16) +#define NBD_CMD_FLAG_FUA ((1 << 0) << NBD_CMD_SHIFT) /* values for flags field */ #define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */ -- 1.9.1