]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide-cd: replace C code with call to ARRAY_SIZE() macro
authorRobert P. J. Day <rpjday@mindspring.com>
Mon, 9 Jul 2007 21:17:57 +0000 (23:17 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 9 Jul 2007 21:17:57 +0000 (23:17 +0200)
Delete the unnecessary macro ARY_LEN and use ARRAY_SIZE directly.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c
drivers/ide/ide-cd.h

index 252ab8295edfd9fef5fc0fb029e0ed33c898e9f0..1486eb212ccc7b2952ebe0d9fba53edd2e5324c2 100644 (file)
@@ -481,7 +481,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
                else
                        printk("  Unknown Error Type: ");
 
-               if (sense->sense_key < ARY_LEN(sense_key_texts))
+               if (sense->sense_key < ARRAY_SIZE(sense_key_texts))
                        s = sense_key_texts[sense->sense_key];
 
                printk("%s -- (Sense key=0x%02x)\n", s, sense->sense_key);
@@ -491,7 +491,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
                                 sense->ascq);
                        s = buf;
                } else {
-                       int lo = 0, mid, hi = ARY_LEN(sense_data_texts);
+                       int lo = 0, mid, hi = ARRAY_SIZE(sense_data_texts);
                        unsigned long key = (sense->sense_key << 16);
                        key |= (sense->asc << 8);
                        if (!(sense->ascq >= 0x80 && sense->ascq <= 0xdd))
@@ -524,7 +524,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
 
                if (failed_command != NULL) {
 
-                       int lo=0, mid, hi= ARY_LEN (packet_command_texts);
+                       int lo=0, mid, hi= ARRAY_SIZE(packet_command_texts);
                        s = NULL;
 
                        while (hi > lo) {
index ad1f2ed14a3723cbcec3081341487e7d784c494c..228b29c5d2e4d0684d6f2490ed6aa7c5a6bfa098 100644 (file)
@@ -498,8 +498,6 @@ struct cdrom_info {
  * Descriptions of ATAPI error codes.
  */
 
-#define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))
-
 /* This stuff should be in cdrom.h, since it is now generic... */
 
 /* ATAPI sense keys (from table 140 of ATAPI 2.6) */