aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aachba.c18
-rw-r--r--drivers/scsi/aacraid/commctrl.c2
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index e4b38f896cbd..ea9e038813eb 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -641,13 +641,13 @@ static void setinqstr(struct aac_dev *dev, void *data, int tindex)
641 cp[sizeof(str->pid)] = c; 641 cp[sizeof(str->pid)] = c;
642 } else { 642 } else {
643 struct aac_driver_ident *mp = aac_get_driver_ident(dev->cardtype); 643 struct aac_driver_ident *mp = aac_get_driver_ident(dev->cardtype);
644 644
645 inqstrcpy (mp->vname, str->vid); 645 inqstrcpy (mp->vname, str->vid);
646 /* last six chars reserved for vol type */ 646 /* last six chars reserved for vol type */
647 inqstrcpy (mp->model, str->pid); 647 inqstrcpy (mp->model, str->pid);
648 } 648 }
649 649
650 if (tindex < (sizeof(container_types)/sizeof(char *))){ 650 if (tindex < ARRAY_SIZE(container_types)){
651 char *findit = str->pid; 651 char *findit = str->pid;
652 652
653 for ( ; *findit != ' '; findit++); /* walk till we find a space */ 653 for ( ; *findit != ' '; findit++); /* walk till we find a space */
@@ -1576,7 +1576,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1576 * see: <vendor>.c i.e. aac.c 1576 * see: <vendor>.c i.e. aac.c
1577 */ 1577 */
1578 if (scmd_id(scsicmd) == host->this_id) { 1578 if (scmd_id(scsicmd) == host->this_id) {
1579 setinqstr(dev, (void *) (inq_data.inqd_vid), (sizeof(container_types)/sizeof(char *))); 1579 setinqstr(dev, (void *) (inq_data.inqd_vid), ARRAY_SIZE(container_types));
1580 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */ 1580 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */
1581 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data)); 1581 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data));
1582 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 1582 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
@@ -2381,7 +2381,7 @@ static struct aac_srb_status_info srb_status_info[] = {
2381 { SRB_STATUS_SUCCESS, "Success"}, 2381 { SRB_STATUS_SUCCESS, "Success"},
2382 { SRB_STATUS_ABORTED, "Aborted Command"}, 2382 { SRB_STATUS_ABORTED, "Aborted Command"},
2383 { SRB_STATUS_ABORT_FAILED, "Abort Failed"}, 2383 { SRB_STATUS_ABORT_FAILED, "Abort Failed"},
2384 { SRB_STATUS_ERROR, "Error Event"}, 2384 { SRB_STATUS_ERROR, "Error Event"},
2385 { SRB_STATUS_BUSY, "Device Busy"}, 2385 { SRB_STATUS_BUSY, "Device Busy"},
2386 { SRB_STATUS_INVALID_REQUEST, "Invalid Request"}, 2386 { SRB_STATUS_INVALID_REQUEST, "Invalid Request"},
2387 { SRB_STATUS_INVALID_PATH_ID, "Invalid Path ID"}, 2387 { SRB_STATUS_INVALID_PATH_ID, "Invalid Path ID"},
@@ -2400,7 +2400,7 @@ static struct aac_srb_status_info srb_status_info[] = {
2400 { SRB_STATUS_BAD_SRB_BLOCK_LENGTH,"Bad Srb Block Length"}, 2400 { SRB_STATUS_BAD_SRB_BLOCK_LENGTH,"Bad Srb Block Length"},
2401 { SRB_STATUS_REQUEST_FLUSHED, "Request Flushed"}, 2401 { SRB_STATUS_REQUEST_FLUSHED, "Request Flushed"},
2402 { SRB_STATUS_DELAYED_RETRY, "Delayed Retry"}, 2402 { SRB_STATUS_DELAYED_RETRY, "Delayed Retry"},
2403 { SRB_STATUS_INVALID_LUN, "Invalid LUN"}, 2403 { SRB_STATUS_INVALID_LUN, "Invalid LUN"},
2404 { SRB_STATUS_INVALID_TARGET_ID, "Invalid TARGET ID"}, 2404 { SRB_STATUS_INVALID_TARGET_ID, "Invalid TARGET ID"},
2405 { SRB_STATUS_BAD_FUNCTION, "Bad Function"}, 2405 { SRB_STATUS_BAD_FUNCTION, "Bad Function"},
2406 { SRB_STATUS_ERROR_RECOVERY, "Error Recovery"}, 2406 { SRB_STATUS_ERROR_RECOVERY, "Error Recovery"},
@@ -2415,11 +2415,9 @@ char *aac_get_status_string(u32 status)
2415{ 2415{
2416 int i; 2416 int i;
2417 2417
2418 for(i=0; i < (sizeof(srb_status_info)/sizeof(struct aac_srb_status_info)); i++ ){ 2418 for (i = 0; i < ARRAY_SIZE(srb_status_info); i++)
2419 if(srb_status_info[i].status == status){ 2419 if (srb_status_info[i].status == status)
2420 return srb_status_info[i].str; 2420 return srb_status_info[i].str;
2421 }
2422 }
2423 2421
2424 return "Bad Status Code"; 2422 return "Bad Status Code";
2425} 2423}
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 9f75144e5247..255421de9d1a 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -535,7 +535,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
535 default: 535 default:
536 data_dir = DMA_NONE; 536 data_dir = DMA_NONE;
537 } 537 }
538 if (user_srbcmd->sg.count > (sizeof(sg_list)/sizeof(sg_list[0]))) { 538 if (user_srbcmd->sg.count > ARRAY_SIZE(sg_list)) {
539 dprintk((KERN_DEBUG"aacraid: too many sg entries %d\n", 539 dprintk((KERN_DEBUG"aacraid: too many sg entries %d\n",
540 le32_to_cpu(srbcmd->sg.count))); 540 le32_to_cpu(srbcmd->sg.count)));
541 rcode = -EINVAL; 541 rcode = -EINVAL;