]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic7xxx/aic79xx_core.c
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic7xxx / aic79xx_core.c
index 08771f6f68594f0cb3524937b9573eb3a81056a3..801fc81d0b202ff296bbbb1394fe6f5cb286ff4c 100644 (file)
@@ -59,7 +59,7 @@ char *ahd_chip_names[] =
        "aic7902",
        "aic7901A"
 };
-static const u_int num_chip_names = NUM_ELEMENTS(ahd_chip_names);
+static const u_int num_chip_names = ARRAY_SIZE(ahd_chip_names);
 
 /*
  * Hardware error codes.
@@ -77,7 +77,7 @@ static struct ahd_hard_error_entry ahd_hard_errors[] = {
        { MPARERR,      "Scratch or SCB Memory Parity Error" },
        { CIOPARERR,    "CIOBUS Parity Error" },
 };
-static const u_int num_errors = NUM_ELEMENTS(ahd_hard_errors);
+static const u_int num_errors = ARRAY_SIZE(ahd_hard_errors);
 
 static struct ahd_phase_table_entry ahd_phase_table[] =
 {
@@ -97,7 +97,7 @@ static struct ahd_phase_table_entry ahd_phase_table[] =
  * In most cases we only wish to itterate over real phases, so
  * exclude the last element from the count.
  */
-static const u_int num_phases = NUM_ELEMENTS(ahd_phase_table) - 1;
+static const u_int num_phases = ARRAY_SIZE(ahd_phase_table) - 1;
 
 /* Our Sequencer Program */
 #include "aic79xx_seq.h"
@@ -7259,7 +7259,7 @@ ahd_qinfifo_count(struct ahd_softc *ahd)
                return (wrap_qinfifonext - wrap_qinpos);
        else
                return (wrap_qinfifonext
-                     + NUM_ELEMENTS(ahd->qinfifo) - wrap_qinpos);
+                     + ARRAY_SIZE(ahd->qinfifo) - wrap_qinpos);
 }
 
 void
@@ -8619,7 +8619,7 @@ ahd_check_patch(struct ahd_softc *ahd, struct patch **start_patch,
        struct  patch *last_patch;
        u_int   num_patches;
 
-       num_patches = sizeof(patches)/sizeof(struct patch);
+       num_patches = ARRAY_SIZE(patches);
        last_patch = &patches[num_patches];
        cur_patch = *start_patch;
 
@@ -9396,8 +9396,8 @@ ahd_find_tmode_devs(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb,
        } else {
                u_int max_id;
 
-               max_id = (ahd->features & AHD_WIDE) ? 15 : 7;
-               if (ccb->ccb_h.target_id > max_id)
+               max_id = (ahd->features & AHD_WIDE) ? 16 : 8;
+               if (ccb->ccb_h.target_id >= max_id)
                        return (CAM_TID_INVALID);
 
                if (ccb->ccb_h.target_lun >= AHD_NUM_LUNS)