diff options
Diffstat (limited to 'drivers/scsi/ibmmca.c')
| -rw-r--r-- | drivers/scsi/ibmmca.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c index 24eb59e143a9..115f55471ed3 100644 --- a/drivers/scsi/ibmmca.c +++ b/drivers/scsi/ibmmca.c | |||
| @@ -1441,7 +1441,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) | |||
| 1441 | struct Scsi_Host *dev = dev_id; | 1441 | struct Scsi_Host *dev = dev_id; |
| 1442 | 1442 | ||
| 1443 | spin_lock_irqsave(dev->host_lock, flags); | 1443 | spin_lock_irqsave(dev->host_lock, flags); |
| 1444 | 1444 | ||
| 1445 | shpnt = dev; /* assign host-structure to local pointer */ | 1445 | shpnt = dev; /* assign host-structure to local pointer */ |
| 1446 | len = 0; /* set filled text-buffer index to 0 */ | 1446 | len = 0; /* set filled text-buffer index to 0 */ |
| 1447 | /* get the _special contents of the hostdata structure */ | 1447 | /* get the _special contents of the hostdata structure */ |
| @@ -1456,7 +1456,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) | |||
| 1456 | /* if the integrated subsystem has been found automatically: */ | 1456 | /* if the integrated subsystem has been found automatically: */ |
| 1457 | len += sprintf(buf + len, | 1457 | len += sprintf(buf + len, |
| 1458 | "Adapter category: integrated\n" "Chip revision level: %d\n" "Chip status: %s\n" "8 kByte NVRAM status: %s\n", ((pos[2] & 0xf0) >> 4), (pos[2] & 1) ? "enabled" : "disabled", (pos[2] & 2) ? "locked" : "accessible"); | 1458 | "Adapter category: integrated\n" "Chip revision level: %d\n" "Chip status: %s\n" "8 kByte NVRAM status: %s\n", ((pos[2] & 0xf0) >> 4), (pos[2] & 1) ? "enabled" : "disabled", (pos[2] & 2) ? "locked" : "accessible"); |
| 1459 | } else if ((speciale >= 0) && (speciale < (sizeof(subsys_list) / sizeof(struct subsys_list_struct)))) { | 1459 | } else if ((speciale >= 0) && (speciale < ARRAY_SIZE(subsys_list))) { |
| 1460 | /* if the subsystem is a slot adapter */ | 1460 | /* if the subsystem is a slot adapter */ |
| 1461 | len += sprintf(buf + len, "Adapter category: slot-card\n" "ROM Segment Address: "); | 1461 | len += sprintf(buf + len, "Adapter category: slot-card\n" "ROM Segment Address: "); |
| 1462 | if ((pos[2] & 0xf0) == 0xf0) | 1462 | if ((pos[2] & 0xf0) == 0xf0) |
| @@ -1477,16 +1477,16 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) | |||
| 1477 | while (len % sizeof(int) != (sizeof(int) - 1)) | 1477 | while (len % sizeof(int) != (sizeof(int) - 1)) |
| 1478 | len += sprintf(buf + len, " "); | 1478 | len += sprintf(buf + len, " "); |
| 1479 | len += sprintf(buf + len, "\n"); | 1479 | len += sprintf(buf + len, "\n"); |
| 1480 | 1480 | ||
| 1481 | spin_unlock_irqrestore(shpnt->host_lock, flags); | 1481 | spin_unlock_irqrestore(shpnt->host_lock, flags); |
| 1482 | 1482 | ||
| 1483 | return len; | 1483 | return len; |
| 1484 | } | 1484 | } |
| 1485 | 1485 | ||
| 1486 | int ibmmca_detect(struct scsi_host_template * scsi_template) | 1486 | int ibmmca_detect(struct scsi_host_template * scsi_template) |
| 1487 | { | 1487 | { |
| 1488 | struct Scsi_Host *shpnt; | 1488 | struct Scsi_Host *shpnt; |
| 1489 | int port, id, i, j, k, list_size, slot; | 1489 | int port, id, i, j, k, slot; |
| 1490 | int devices_on_irq_11 = 0; | 1490 | int devices_on_irq_11 = 0; |
| 1491 | int devices_on_irq_14 = 0; | 1491 | int devices_on_irq_14 = 0; |
| 1492 | int IRQ14_registered = 0; | 1492 | int IRQ14_registered = 0; |
| @@ -1603,8 +1603,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template) | |||
| 1603 | /* now look for other adapters in MCA slots, */ | 1603 | /* now look for other adapters in MCA slots, */ |
| 1604 | /* determine the number of known IBM-SCSI-subsystem types */ | 1604 | /* determine the number of known IBM-SCSI-subsystem types */ |
| 1605 | /* see the pos[2] dependence to get the adapter port-offset. */ | 1605 | /* see the pos[2] dependence to get the adapter port-offset. */ |
| 1606 | list_size = sizeof(subsys_list) / sizeof(struct subsys_list_struct); | 1606 | for (i = 0; i < ARRAY_SIZE(subsys_list); i++) { |
| 1607 | for (i = 0; i < list_size; i++) { | ||
| 1608 | /* scan each slot for a fitting adapter id */ | 1607 | /* scan each slot for a fitting adapter id */ |
| 1609 | slot = 0; /* start at slot 0 */ | 1608 | slot = 0; /* start at slot 0 */ |
| 1610 | while ((slot = mca_find_adapter(subsys_list[i].mca_id, slot)) | 1609 | while ((slot = mca_find_adapter(subsys_list[i].mca_id, slot)) |
| @@ -1669,8 +1668,7 @@ int ibmmca_detect(struct scsi_host_template * scsi_template) | |||
| 1669 | /* now check for SCSI-adapters, mapped to the integrated SCSI | 1668 | /* now check for SCSI-adapters, mapped to the integrated SCSI |
| 1670 | * area. E.g. a W/Cache in MCA-slot 9(!). Do the check correct here, | 1669 | * area. E.g. a W/Cache in MCA-slot 9(!). Do the check correct here, |
| 1671 | * as this is a known effect on some models 95xx. */ | 1670 | * as this is a known effect on some models 95xx. */ |
| 1672 | list_size = sizeof(subsys_list) / sizeof(struct subsys_list_struct); | 1671 | for (i = 0; i < ARRAY_SIZE(subsys_list); i++) { |
| 1673 | for (i = 0; i < list_size; i++) { | ||
| 1674 | /* scan each slot for a fitting adapter id */ | 1672 | /* scan each slot for a fitting adapter id */ |
| 1675 | slot = mca_find_adapter(subsys_list[i].mca_id, MCA_INTEGSCSI); | 1673 | slot = mca_find_adapter(subsys_list[i].mca_id, MCA_INTEGSCSI); |
| 1676 | if (slot != MCA_NOTFOUND) { /* scan through all slots */ | 1674 | if (slot != MCA_NOTFOUND) { /* scan through all slots */ |
| @@ -2243,8 +2241,7 @@ static int __ibmmca_host_reset(Scsi_Cmnd * cmd) | |||
| 2243 | int host_index; | 2241 | int host_index; |
| 2244 | unsigned long imm_command; | 2242 | unsigned long imm_command; |
| 2245 | 2243 | ||
| 2246 | if (cmd == NULL) | 2244 | BUG_ON(cmd == NULL); |
| 2247 | BUG(); | ||
| 2248 | 2245 | ||
| 2249 | ticks = IM_RESET_DELAY * HZ; | 2246 | ticks = IM_RESET_DELAY * HZ; |
| 2250 | shpnt = cmd->device->host; | 2247 | shpnt = cmd->device->host; |
