aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2008-01-13 01:46:13 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:27 -0500
commitb80ca4f7ee36c26d300c5a8f429e73372d153379 (patch)
tree277987f64a44e793eb35c0bde3e48b582fad445a /drivers/scsi/qla4xxx
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/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 4a154beb0d39..0f029d0d7315 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -123,15 +123,14 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
123 break; 123 break;
124 124
125 /* Copy Sense Data into sense buffer. */ 125 /* Copy Sense Data into sense buffer. */
126 memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer)); 126 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
127 127
128 sensebytecnt = le16_to_cpu(sts_entry->senseDataByteCnt); 128 sensebytecnt = le16_to_cpu(sts_entry->senseDataByteCnt);
129 if (sensebytecnt == 0) 129 if (sensebytecnt == 0)
130 break; 130 break;
131 131
132 memcpy(cmd->sense_buffer, sts_entry->senseData, 132 memcpy(cmd->sense_buffer, sts_entry->senseData,
133 min(sensebytecnt, 133 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
134 (uint16_t) sizeof(cmd->sense_buffer)));
135 134
136 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, " 135 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
137 "ASC/ASCQ = %02x/%02x\n", ha->host_no, 136 "ASC/ASCQ = %02x/%02x\n", ha->host_no,
@@ -208,8 +207,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
208 break; 207 break;
209 208
210 /* Copy Sense Data into sense buffer. */ 209 /* Copy Sense Data into sense buffer. */
211 memset(cmd->sense_buffer, 0, 210 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
212 sizeof(cmd->sense_buffer));
213 211
214 sensebytecnt = 212 sensebytecnt =
215 le16_to_cpu(sts_entry->senseDataByteCnt); 213 le16_to_cpu(sts_entry->senseDataByteCnt);
@@ -217,8 +215,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
217 break; 215 break;
218 216
219 memcpy(cmd->sense_buffer, sts_entry->senseData, 217 memcpy(cmd->sense_buffer, sts_entry->senseData,
220 min(sensebytecnt, 218 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
221 (uint16_t) sizeof(cmd->sense_buffer)));
222 219
223 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, " 220 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
224 "ASC/ASCQ = %02x/%02x\n", ha->host_no, 221 "ASC/ASCQ = %02x/%02x\n", ha->host_no,