aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2008-01-13 15:46:13 +0900
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 11:29:27 -0600
commitb80ca4f7ee36c26d300c5a8f429e73372d153379 (patch)
tree277987f64a44e793eb35c0bde3e48b582fad445a /drivers/scsi/aacraid
parent94aa5e5f6251ca0e1d77e083f8c2f9f40ee548c5 (diff)
[SCSI] replace sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE
This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in several LLDs. It's a preparation for the future changes to remove sense_buffer array in scsi_cmnd structure. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aachba.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 62d95165d2a..aadedbd6308 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -912,8 +912,8 @@ static int aac_bounds_32(struct aac_dev * dev, struct scsi_cmnd * cmd, u64 lba)
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0,
0, 0);
memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
- (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(cmd->sense_buffer))
- ? sizeof(cmd->sense_buffer)
+ (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE)
+ ? SCSI_SENSE_BUFFERSIZE
: sizeof(dev->fsa_dev[cid].sense_data));
cmd->scsi_done(cmd);
return 1;
@@ -1525,8 +1525,8 @@ static void io_callback(void *context, struct fib * fibptr)
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0,
0, 0);
memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
- (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer))
- ? sizeof(scsicmd->sense_buffer)
+ (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE)
+ ? SCSI_SENSE_BUFFERSIZE
: sizeof(dev->fsa_dev[cid].sense_data));
}
aac_fib_complete(fibptr);
@@ -1739,8 +1739,8 @@ static void synchronize_callback(void *context, struct fib *fibptr)
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0,
0, 0);
memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
- min(sizeof(dev->fsa_dev[cid].sense_data),
- sizeof(cmd->sense_buffer)));
+ min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data),
+ SCSI_SENSE_BUFFERSIZE));
}
aac_fib_complete(fibptr);
@@ -1949,8 +1949,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
SENCODE_INVALID_COMMAND,
ASENCODE_INVALID_COMMAND, 0, 0, 0, 0);
memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
- (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer))
- ? sizeof(scsicmd->sense_buffer)
+ (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE)
+ ? SCSI_SENSE_BUFFERSIZE
: sizeof(dev->fsa_dev[cid].sense_data));
scsicmd->scsi_done(scsicmd);
return 0;
@@ -2002,8 +2002,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
memcpy(scsicmd->sense_buffer,
&dev->fsa_dev[cid].sense_data,
(sizeof(dev->fsa_dev[cid].sense_data) >
- sizeof(scsicmd->sense_buffer))
- ? sizeof(scsicmd->sense_buffer)
+ SCSI_SENSE_BUFFERSIZE)
+ ? SCSI_SENSE_BUFFERSIZE
: sizeof(dev->fsa_dev[cid].sense_data));
}
scsicmd->scsi_done(scsicmd);
@@ -2259,8 +2259,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND,
ASENCODE_INVALID_COMMAND, 0, 0, 0, 0);
memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
- (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer))
- ? sizeof(scsicmd->sense_buffer)
+ (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE)
+ ? SCSI_SENSE_BUFFERSIZE
: sizeof(dev->fsa_dev[cid].sense_data));
scsicmd->scsi_done(scsicmd);
return 0;
@@ -2422,8 +2422,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
int len;
printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status));
len = (le32_to_cpu(srbreply->sense_data_size) >
- sizeof(scsicmd->sense_buffer)) ?
- sizeof(scsicmd->sense_buffer) :
+ SCSI_SENSE_BUFFERSIZE) ?
+ SCSI_SENSE_BUFFERSIZE :
le32_to_cpu(srbreply->sense_data_size);
scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
memcpy(scsicmd->sense_buffer, srbreply->sense_data, len);
@@ -2528,8 +2528,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
int len;
scsicmd->result |= SAM_STAT_CHECK_CONDITION;
len = (le32_to_cpu(srbreply->sense_data_size) >
- sizeof(scsicmd->sense_buffer)) ?
- sizeof(scsicmd->sense_buffer) :
+ SCSI_SENSE_BUFFERSIZE) ?
+ SCSI_SENSE_BUFFERSIZE :
le32_to_cpu(srbreply->sense_data_size);
#ifdef AAC_DETAILED_STATUS_INFO
printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n",