aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aachba.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-06-09 01:23:48 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 11:45:30 -0400
commit6391a11375de5e2bb1eb8481e54619761dc65d9f (patch)
tree956aae1d278a3f731b2e6148ff40a69aa7957ea8 /drivers/scsi/aacraid/aachba.c
parent9dc399de0840a478adb71278becf598d3ab3aacc (diff)
[SCSI] drivers/scsi: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r--drivers/scsi/aacraid/aachba.c18
1 files changed, 8 insertions, 10 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}