diff options
author | Hannes Reinecke <hare@suse.de> | 2006-05-23 04:29:28 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-05-28 13:07:41 -0400 |
commit | 2b89dad0c7e3b03d45d9674ee9a7b49670df098e (patch) | |
tree | 8f480172c865e9d6cfab9ed4888a043bc75ab4ce /drivers | |
parent | 091686d3b5569d2ec76b9e6dab7f3608b6f64497 (diff) |
[SCSI] audit drivers for incorrect max_id use
max_id now means the maximum number of ids on the bus, which means it
is one greater than the largest possible id number.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/53c700.c | 2 | ||||
-rw-r--r-- | drivers/scsi/53c7xx.c | 4 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 4 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_core.c | 4 | ||||
-rw-r--r-- | drivers/scsi/atp870u.c | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 6a0f9506ea00..b767918b9a98 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c | |||
@@ -376,7 +376,7 @@ NCR_700_detect(struct scsi_host_template *tpnt, | |||
376 | dma_sync_single_for_device(hostdata->dev, pScript, sizeof(SCRIPT), DMA_TO_DEVICE); | 376 | dma_sync_single_for_device(hostdata->dev, pScript, sizeof(SCRIPT), DMA_TO_DEVICE); |
377 | hostdata->state = NCR_700_HOST_FREE; | 377 | hostdata->state = NCR_700_HOST_FREE; |
378 | hostdata->cmd = NULL; | 378 | hostdata->cmd = NULL; |
379 | host->max_id = 7; | 379 | host->max_id = 8; |
380 | host->max_lun = NCR_700_MAX_LUNS; | 380 | host->max_lun = NCR_700_MAX_LUNS; |
381 | BUG_ON(NCR_700_transport_template == NULL); | 381 | BUG_ON(NCR_700_transport_template == NULL); |
382 | host->transportt = NCR_700_transport_template; | 382 | host->transportt = NCR_700_transport_template; |
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c index 7894b8ea84bd..cfc991271cc8 100644 --- a/drivers/scsi/53c7xx.c +++ b/drivers/scsi/53c7xx.c | |||
@@ -709,7 +709,7 @@ request_synchronous (int host, int target) { | |||
709 | printk (KERN_ALERT "target %d is host ID\n", target); | 709 | printk (KERN_ALERT "target %d is host ID\n", target); |
710 | return -1; | 710 | return -1; |
711 | } | 711 | } |
712 | else if (target > h->max_id) { | 712 | else if (target >= h->max_id) { |
713 | printk (KERN_ALERT "target %d exceeds maximum of %d\n", target, | 713 | printk (KERN_ALERT "target %d exceeds maximum of %d\n", target, |
714 | h->max_id); | 714 | h->max_id); |
715 | return -1; | 715 | return -1; |
@@ -3622,7 +3622,7 @@ NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) { | |||
3622 | #ifdef LINUX_1_2 | 3622 | #ifdef LINUX_1_2 |
3623 | || cmd->device->id > 7 | 3623 | || cmd->device->id > 7 |
3624 | #else | 3624 | #else |
3625 | || cmd->device->id > host->max_id | 3625 | || cmd->device->id >= host->max_id |
3626 | #endif | 3626 | #endif |
3627 | || cmd->device->id == host->this_id | 3627 | || cmd->device->id == host->this_id |
3628 | || hostdata->state == STATE_DISABLED) { | 3628 | || hostdata->state == STATE_DISABLED) { |
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 08771f6f6859..e14244aa69d7 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -9396,8 +9396,8 @@ ahd_find_tmode_devs(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb, | |||
9396 | } else { | 9396 | } else { |
9397 | u_int max_id; | 9397 | u_int max_id; |
9398 | 9398 | ||
9399 | max_id = (ahd->features & AHD_WIDE) ? 15 : 7; | 9399 | max_id = (ahd->features & AHD_WIDE) ? 16 : 8; |
9400 | if (ccb->ccb_h.target_id > max_id) | 9400 | if (ccb->ccb_h.target_id >= max_id) |
9401 | return (CAM_TID_INVALID); | 9401 | return (CAM_TID_INVALID); |
9402 | 9402 | ||
9403 | if (ccb->ccb_h.target_lun >= AHD_NUM_LUNS) | 9403 | if (ccb->ccb_h.target_lun >= AHD_NUM_LUNS) |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index d37566978fba..50a3dd047cfe 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c | |||
@@ -6774,8 +6774,8 @@ ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb, | |||
6774 | } else { | 6774 | } else { |
6775 | u_int max_id; | 6775 | u_int max_id; |
6776 | 6776 | ||
6777 | max_id = (ahc->features & AHC_WIDE) ? 15 : 7; | 6777 | max_id = (ahc->features & AHC_WIDE) ? 16 : 8; |
6778 | if (ccb->ccb_h.target_id > max_id) | 6778 | if (ccb->ccb_h.target_id >= max_id) |
6779 | return (CAM_TID_INVALID); | 6779 | return (CAM_TID_INVALID); |
6780 | 6780 | ||
6781 | if (ccb->ccb_h.target_lun >= AHC_NUM_LUNS) | 6781 | if (ccb->ccb_h.target_lun >= AHC_NUM_LUNS) |
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index a198d86667e9..58d7e34807aa 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c | |||
@@ -3047,7 +3047,7 @@ flash_ok_885: | |||
3047 | if (atp_dev.chip_ver == 4) | 3047 | if (atp_dev.chip_ver == 4) |
3048 | shpnt->max_id = 16; | 3048 | shpnt->max_id = 16; |
3049 | else | 3049 | else |
3050 | shpnt->max_id = 7; | 3050 | shpnt->max_id = 8; |
3051 | shpnt->this_id = host_id; | 3051 | shpnt->this_id = host_id; |
3052 | shpnt->unique_id = base_io; | 3052 | shpnt->unique_id = base_io; |
3053 | shpnt->io_port = base_io; | 3053 | shpnt->io_port = base_io; |