diff options
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 62d95165d2a6..aadedbd63083 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) | |||
912 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, | 912 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, |
913 | 0, 0); | 913 | 0, 0); |
914 | memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data, | 914 | memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data, |
915 | (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(cmd->sense_buffer)) | 915 | (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE) |
916 | ? sizeof(cmd->sense_buffer) | 916 | ? SCSI_SENSE_BUFFERSIZE |
917 | : sizeof(dev->fsa_dev[cid].sense_data)); | 917 | : sizeof(dev->fsa_dev[cid].sense_data)); |
918 | cmd->scsi_done(cmd); | 918 | cmd->scsi_done(cmd); |
919 | return 1; | 919 | return 1; |
@@ -1525,8 +1525,8 @@ static void io_callback(void *context, struct fib * fibptr) | |||
1525 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, | 1525 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, |
1526 | 0, 0); | 1526 | 0, 0); |
1527 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, | 1527 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, |
1528 | (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer)) | 1528 | (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE) |
1529 | ? sizeof(scsicmd->sense_buffer) | 1529 | ? SCSI_SENSE_BUFFERSIZE |
1530 | : sizeof(dev->fsa_dev[cid].sense_data)); | 1530 | : sizeof(dev->fsa_dev[cid].sense_data)); |
1531 | } | 1531 | } |
1532 | aac_fib_complete(fibptr); | 1532 | aac_fib_complete(fibptr); |
@@ -1739,8 +1739,8 @@ static void synchronize_callback(void *context, struct fib *fibptr) | |||
1739 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, | 1739 | ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, |
1740 | 0, 0); | 1740 | 0, 0); |
1741 | memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data, | 1741 | memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data, |
1742 | min(sizeof(dev->fsa_dev[cid].sense_data), | 1742 | min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data), |
1743 | sizeof(cmd->sense_buffer))); | 1743 | SCSI_SENSE_BUFFERSIZE)); |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | aac_fib_complete(fibptr); | 1746 | aac_fib_complete(fibptr); |
@@ -1949,8 +1949,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
1949 | SENCODE_INVALID_COMMAND, | 1949 | SENCODE_INVALID_COMMAND, |
1950 | ASENCODE_INVALID_COMMAND, 0, 0, 0, 0); | 1950 | ASENCODE_INVALID_COMMAND, 0, 0, 0, 0); |
1951 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, | 1951 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, |
1952 | (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer)) | 1952 | (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE) |
1953 | ? sizeof(scsicmd->sense_buffer) | 1953 | ? SCSI_SENSE_BUFFERSIZE |
1954 | : sizeof(dev->fsa_dev[cid].sense_data)); | 1954 | : sizeof(dev->fsa_dev[cid].sense_data)); |
1955 | scsicmd->scsi_done(scsicmd); | 1955 | scsicmd->scsi_done(scsicmd); |
1956 | return 0; | 1956 | return 0; |
@@ -2002,8 +2002,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
2002 | memcpy(scsicmd->sense_buffer, | 2002 | memcpy(scsicmd->sense_buffer, |
2003 | &dev->fsa_dev[cid].sense_data, | 2003 | &dev->fsa_dev[cid].sense_data, |
2004 | (sizeof(dev->fsa_dev[cid].sense_data) > | 2004 | (sizeof(dev->fsa_dev[cid].sense_data) > |
2005 | sizeof(scsicmd->sense_buffer)) | 2005 | SCSI_SENSE_BUFFERSIZE) |
2006 | ? sizeof(scsicmd->sense_buffer) | 2006 | ? SCSI_SENSE_BUFFERSIZE |
2007 | : sizeof(dev->fsa_dev[cid].sense_data)); | 2007 | : sizeof(dev->fsa_dev[cid].sense_data)); |
2008 | } | 2008 | } |
2009 | scsicmd->scsi_done(scsicmd); | 2009 | scsicmd->scsi_done(scsicmd); |
@@ -2259,8 +2259,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
2259 | ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND, | 2259 | ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND, |
2260 | ASENCODE_INVALID_COMMAND, 0, 0, 0, 0); | 2260 | ASENCODE_INVALID_COMMAND, 0, 0, 0, 0); |
2261 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, | 2261 | memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, |
2262 | (sizeof(dev->fsa_dev[cid].sense_data) > sizeof(scsicmd->sense_buffer)) | 2262 | (sizeof(dev->fsa_dev[cid].sense_data) > SCSI_SENSE_BUFFERSIZE) |
2263 | ? sizeof(scsicmd->sense_buffer) | 2263 | ? SCSI_SENSE_BUFFERSIZE |
2264 | : sizeof(dev->fsa_dev[cid].sense_data)); | 2264 | : sizeof(dev->fsa_dev[cid].sense_data)); |
2265 | scsicmd->scsi_done(scsicmd); | 2265 | scsicmd->scsi_done(scsicmd); |
2266 | return 0; | 2266 | return 0; |
@@ -2422,8 +2422,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr) | |||
2422 | int len; | 2422 | int len; |
2423 | printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status)); | 2423 | printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status)); |
2424 | len = (le32_to_cpu(srbreply->sense_data_size) > | 2424 | len = (le32_to_cpu(srbreply->sense_data_size) > |
2425 | sizeof(scsicmd->sense_buffer)) ? | 2425 | SCSI_SENSE_BUFFERSIZE) ? |
2426 | sizeof(scsicmd->sense_buffer) : | 2426 | SCSI_SENSE_BUFFERSIZE : |
2427 | le32_to_cpu(srbreply->sense_data_size); | 2427 | le32_to_cpu(srbreply->sense_data_size); |
2428 | scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; | 2428 | scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; |
2429 | memcpy(scsicmd->sense_buffer, srbreply->sense_data, len); | 2429 | memcpy(scsicmd->sense_buffer, srbreply->sense_data, len); |
@@ -2528,8 +2528,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr) | |||
2528 | int len; | 2528 | int len; |
2529 | scsicmd->result |= SAM_STAT_CHECK_CONDITION; | 2529 | scsicmd->result |= SAM_STAT_CHECK_CONDITION; |
2530 | len = (le32_to_cpu(srbreply->sense_data_size) > | 2530 | len = (le32_to_cpu(srbreply->sense_data_size) > |
2531 | sizeof(scsicmd->sense_buffer)) ? | 2531 | SCSI_SENSE_BUFFERSIZE) ? |
2532 | sizeof(scsicmd->sense_buffer) : | 2532 | SCSI_SENSE_BUFFERSIZE : |
2533 | le32_to_cpu(srbreply->sense_data_size); | 2533 | le32_to_cpu(srbreply->sense_data_size); |
2534 | #ifdef AAC_DETAILED_STATUS_INFO | 2534 | #ifdef AAC_DETAILED_STATUS_INFO |
2535 | printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n", | 2535 | printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n", |