[Stgt-devel] [PATCH 1/4] compile fixes

Pete Wyckoff pw
Mon Jan 22 20:02:45 CET 2007


Compile fixes.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 usr/scsi.c   |    6 ++++--
 usr/target.c |    4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/usr/scsi.c b/usr/scsi.c
index 9e91a9f..e65e893 100644
--- a/usr/scsi.c
+++ b/usr/scsi.c
@@ -224,7 +224,8 @@ static int __inquiry(struct tgt_device *dev, int host_no, uint8_t *lun_buf,
 			result = SAM_STAT_GOOD;
 
 			if (dev && strlen(dev->scsi_sn)) {
-				char *p, *q;
+				uint8_t *p;
+				char *q;
 
 				p = data + 4 + tmp - 1;
 				q = dev->scsi_sn + SCSI_SN_LEN - 1;
@@ -241,7 +242,8 @@ static int __inquiry(struct tgt_device *dev, int host_no, uint8_t *lun_buf,
 			data[5] = 0x1;
 			data[7] = tmp;
 			if (dev)
-				strncpy(data + 8, dev->scsi_id, SCSI_ID_LEN);
+				strncpy((char *) data + 8, dev->scsi_id,
+				        SCSI_ID_LEN);
 			*len = tmp + 8;
 			result = SAM_STAT_GOOD;
 		}
diff --git a/usr/target.c b/usr/target.c
index e0a4698..93e7531 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -352,7 +352,7 @@ static int cmd_enabled(struct tgt_cmd_queue *q, struct cmd *cmd)
 
 	if (cmd->attribute != MSG_SIMPLE_TAG)
 		dprintf("non simple attribute %" PRIx64 " %x %" PRIu64 " %d\n",
-			cmd->tag, cmd->attribute, cmd->dev ? cmd->dev->lun : ~0ULL,
+			cmd->tag, cmd->attribute, cmd->dev ? cmd->dev->lun : UINT64_MAX,
 			q->active_cmd);
 
 	switch (cmd->attribute) {
@@ -477,7 +477,7 @@ int target_cmd_queue(uint64_t nid, uint8_t *scb, uint8_t rw,
 	} else {
 		set_cmd_queued(cmd);
 		dprintf("blocked %" PRIx64 " %x %" PRIu64 " %d\n",
-			tag, scb[0], cmd->dev ? cmd->dev->lun : ~0ULL,
+			tag, scb[0], cmd->dev ? cmd->dev->lun : UINT64_MAX,
 			q->active_cmd);
 
 		memcpy(cmd->scb, scb, sizeof(cmd->scb));
-- 
1.4.4.2




More information about the stgt mailing list