[Stgt-devel] [PATCH] stgt: compile fixes

FUJITA Tomonori fujita.tomonori
Mon Jan 22 08:03:06 CET 2007


From: Pete Wyckoff <pw at osc.edu>
Subject: [Stgt-devel] [PATCH] stgt: compile fixes
Date: Sun, 21 Jan 2007 11:26:28 -0500

> These show up on x86_64 gcc 4.1.1.  Trivial fixes.

Thanks.


> Signed-off-by: Pete Wyckoff <pw at osc.edu>
> ---
> 
> Index: scsi.c
> ===================================================================
> --- scsi.c	(revision 767)
> +++ scsi.c	(working copy)
> @@ -224,7 +224,8 @@ static int __inquiry(struct tgt_device *
>  			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 *
>  			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;
>  		}
> Index: target.c
> ===================================================================
> --- target.c	(revision 767)
> +++ target.c	(working copy)
> @@ -352,7 +352,7 @@ static int cmd_enabled(struct tgt_cmd_qu
>  
>  	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_t) -1,
>  			q->active_cmd);

UINT64_MAX works?

# I'd like to remove this dirty check on luns but it's necessary for
# some time.


>  	switch (cmd->attribute) {
> @@ -477,7 +477,7 @@ int target_cmd_queue(uint64_t nid, uint8
>  	} 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_t) -1,
>  			q->active_cmd);

ditto.



More information about the stgt mailing list