X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Faic7xxx%2Faic79xx_core.c;h=801fc81d0b202ff296bbbb1394fe6f5cb286ff4c;hb=a8c4c20dfa8b28a3c99e33c639d9c2ea5657741e;hp=08771f6f68594f0cb3524937b9573eb3a81056a3;hpb=8fc65162a8f25929be80c8d6321a3479e92b5aae;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 08771f6f685..801fc81d0b2 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -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)