From patchwork Fri Apr 1 10:46:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bligh X-Patchwork-Id: 8722311 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B09F9FC89 for ; Fri, 1 Apr 2016 10:46:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8928A203B1 for ; Fri, 1 Apr 2016 10:46:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC807203AE for ; Fri, 1 Apr 2016 10:46:51 +0000 (UTC) Received: from localhost ([::1]:43321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwbL-0007WE-Cd for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Apr 2016 06:46:51 -0400 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 Received: by mail.avalus.com (Postfix) with ESMTPSA id B2B14C560A0; Fri, 1 Apr 2016 11:46:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alex.org.uk; s=mail; t=1459507594; bh=5Bnhn1d346jsxwPY8XkI8SQxlrhBcv0CQdBkOlPVwEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=0WOWqFoKmFz9YX1DkyFb9/Rna4Kb5qkdNaFBHyLEMtBLx5+bQ63I3gH/ZYjPAWHkU 4CBlS+Z/5ucxYHdKg+zbACfr7BhPprfVVWeON8oEgQEvBol6ZF/d51cAxKl33ZrBss Sgnn6AmzQAtgtpAng+bvMkWPClmopLY3AvtrMeh0= From: Alex Bligh To: Eric Blake , Wouter Verhelst Date: Fri, 1 Apr 2016 11:46:30 +0100 Message-Id: <1459507590-1191-2-git-send-email-alex@alex.org.uk> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459507590-1191-1-git-send-email-alex@alex.org.uk> References: <1459507590-1191-1-git-send-email-alex@alex.org.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:41c8:10:1dd::10 Cc: "nbd-general@lists.sourceforge.net" , "qemu-devel@nongnu.org" , Alex Bligh Subject: [Qemu-devel] [PATCHv2 2/2] Correct definition of NBD_CMD_FLAG_FUA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Blake --- 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 */