[stgt] [PATCH] use NR_SCSI_OPCODES definition

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Nov 25 00:16:40 CET 2013


Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 usr/spc.c  |    2 +-
 usr/tgtd.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 9faa705..29f39a9 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -735,7 +735,7 @@ static int report_opcodes_all(struct scsi_cmd *cmd, int rctd,
 	data = &buf[4];
 
 	ops = cmd->dev->dev_type_template.ops;
-	for (i = 0; i < 256; i++) {
+	for (i = 0; i < NR_SCSI_OPCODES; i++) {
 		if (ops[i].cmd_perform == spc_illegal_op)
 			continue;
 
diff --git a/usr/tgtd.h b/usr/tgtd.h
index 850a110..8a25521 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -153,7 +153,7 @@ struct device_type_template {
 	tgtadm_err (*lu_offline)(struct scsi_lu *lu);
 	int (*cmd_passthrough)(int, struct scsi_cmd *);
 
-	struct device_type_operations ops[256];
+	struct device_type_operations ops[NR_SCSI_OPCODES];
 
 	struct list_head device_type_siblings;
 };
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list