From patchwork Wed Jun 28 05:58:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9813513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EECFE6020A for ; Wed, 28 Jun 2017 05:59:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2BAA280CF for ; Wed, 28 Jun 2017 05:59:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6BC1283FB; Wed, 28 Jun 2017 05:59:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA28280CF for ; Wed, 28 Jun 2017 05:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbdF1F7i (ORCPT ); Wed, 28 Jun 2017 01:59:38 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:39551 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbdF1F7i (ORCPT ); Wed, 28 Jun 2017 01:59:38 -0400 X-IronPort-AV: E=Sophos;i="5.40,274,1496073600"; d="scan'208";a="29784190" Received: from sjappemgw12.hgst.com (HELO sjappemgw11.hgst.com) ([199.255.44.66]) by ob1.hgst.iphmx.com with ESMTP; 28 Jun 2017 13:59:38 +0800 Received: from washi.fujisawa.hgst.com ([10.80.170.19]) by sjappemgw11.hgst.com with ESMTP; 27 Jun 2017 22:59:02 -0700 From: Damien Le Moal To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, "Nicholas A . Bellinger" Cc: "Martin K . Petersen" , Hannes Reinecke , Bart Van Assche Subject: [PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes Date: Wed, 28 Jun 2017 14:58:56 +0900 Message-Id: <20170628055900.22889-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170628055900.22889-1-damien.lemoal@wdc.com> References: <20170628055900.22889-1-damien.lemoal@wdc.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add WRITE_VERIFY_32 definition to scsi prototypes and use this macro definition isntead of the hard coded value. Same for the already defined WRITE_VERIFY_16 command code. Signed-off-by: Damien Le Moal --- drivers/target/target_core_device.c | 4 ++-- include/scsi/scsi_proto.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 8add07f38..15dcbb9 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -1126,7 +1126,7 @@ passthrough_parse_cdb(struct se_cmd *cmd, case WRITE_16: case WRITE_VERIFY: case WRITE_VERIFY_12: - case 0x8e: /* WRITE_VERIFY_16 */ + case WRITE_VERIFY_16: case COMPARE_AND_WRITE: case XDWRITEREAD_10: cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB; @@ -1135,7 +1135,7 @@ passthrough_parse_cdb(struct se_cmd *cmd, switch (get_unaligned_be16(&cdb[8])) { case READ_32: case WRITE_32: - case 0x0c: /* WRITE_VERIFY_32 */ + case WRITE_VERIFY_32: case XDWRITEREAD_32: cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB; break; diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h index ce78ec8..5e3fe03 100644 --- a/include/scsi/scsi_proto.h +++ b/include/scsi/scsi_proto.h @@ -161,6 +161,7 @@ #define READ_32 0x09 #define VERIFY_32 0x0a #define WRITE_32 0x0b +#define WRITE_VERIFY_32 0x0c #define WRITE_SAME_32 0x0d /* Values for T10/04-262r7 */