Re: [PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes

2017-07-06 Thread Nicholas A. Bellinger
Hi Damien,

On Wed, 2017-06-28 at 14:58 +0900, Damien Le Moal wrote:
> 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(-)

Note the WRITE_VERIFY_16 macro usage has already been changed by
commit 500073bb23 in target-pending/for-next.

So applied to target-pending/for-next for the WRITE_VERIFY_32 specific
bits.



[PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes

2017-06-28 Thread Damien Le Moal
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([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_320x0a
 #define WRITE_32 0x0b
+#define WRITE_VERIFY_32  0x0c
 #define WRITE_SAME_320x0d
 
 /* Values for T10/04-262r7 */
-- 
2.9.4