aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-xxxx.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/3w-xxxx.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/3w-xxxx.c')
-rw-r--r--drivers/scsi/3w-xxxx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 37a58c6dad29..17dbd4ac8692 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -405,7 +405,7 @@ static int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill
405 /* Attempt to return intelligent sense information */ 405 /* Attempt to return intelligent sense information */
406 if (fill_sense) { 406 if (fill_sense) {
407 if ((command->status == 0xc7) || (command->status == 0xcb)) { 407 if ((command->status == 0xc7) || (command->status == 0xcb)) {
408 for (i=0;i<(sizeof(tw_sense_table)/sizeof(tw_sense_table[0]));i++) { 408 for (i = 0; i < ARRAY_SIZE(tw_sense_table); i++) {
409 if (command->flags == tw_sense_table[i][0]) { 409 if (command->flags == tw_sense_table[i][0]) {
410 410
411 /* Valid bit and 'current errors' */ 411 /* Valid bit and 'current errors' */
@@ -625,7 +625,7 @@ static int tw_aen_complete(TW_Device_Extension *tw_dev, int request_id)
625 if (aen == 0x0ff) { 625 if (aen == 0x0ff) {
626 printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: INFO: AEN queue overflow.\n", tw_dev->host->host_no); 626 printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: INFO: AEN queue overflow.\n", tw_dev->host->host_no);
627 } else { 627 } else {
628 table_max = sizeof(tw_aen_string)/sizeof(char *); 628 table_max = ARRAY_SIZE(tw_aen_string);
629 if ((aen & 0x0ff) < table_max) { 629 if ((aen & 0x0ff) < table_max) {
630 if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') { 630 if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
631 printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: %s%d.\n", tw_dev->host->host_no, tw_aen_string[aen & 0xff], aen >> 8); 631 printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: %s%d.\n", tw_dev->host->host_no, tw_aen_string[aen & 0xff], aen >> 8);
@@ -786,7 +786,7 @@ static int tw_aen_drain_queue(TW_Device_Extension *tw_dev)
786 if (aen == 0x0ff) { 786 if (aen == 0x0ff) {
787 printk(KERN_WARNING "3w-xxxx: AEN: INFO: AEN queue overflow.\n"); 787 printk(KERN_WARNING "3w-xxxx: AEN: INFO: AEN queue overflow.\n");
788 } else { 788 } else {
789 table_max = sizeof(tw_aen_string)/sizeof(char *); 789 table_max = ARRAY_SIZE(tw_aen_string);
790 if ((aen & 0x0ff) < table_max) { 790 if ((aen & 0x0ff) < table_max) {
791 if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') { 791 if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
792 printk(KERN_WARNING "3w-xxxx: AEN: %s%d.\n", tw_aen_string[aen & 0xff], aen >> 8); 792 printk(KERN_WARNING "3w-xxxx: AEN: %s%d.\n", tw_aen_string[aen & 0xff], aen >> 8);