X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fibmmca.c;h=0c6dc31bb14dee7fe66849da86d0d94c300b560c;hb=f0cd91a68acdc9b49d7f6738b514a426da627649;hp=8d97999db60e8c32bf0e702ae6953a27e44ef02b;hpb=3b621ee5df437d3f332a635ab6421aaa61a7dc2b;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c index 8d97999db60..0c6dc31bb14 100644 --- a/drivers/scsi/ibmmca.c +++ b/drivers/scsi/ibmmca.c @@ -492,7 +492,7 @@ static char *ibmrate(unsigned int, int); static int probe_display(int); static int probe_bus_mode(int); static int device_exists(int, int, int *, int *); -static struct Scsi_Host *ibmmca_register(Scsi_Host_Template *, int, int, int, char *); +static struct Scsi_Host *ibmmca_register(struct scsi_host_template *, int, int, int, char *); static int option_setup(char *); /* local functions needed for proc_info */ static int ldn_access_load(int, int); @@ -1441,7 +1441,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); - + shpnt = dev; /* assign host-structure to local pointer */ len = 0; /* set filled text-buffer index to 0 */ /* get the _special contents of the hostdata structure */ @@ -1456,7 +1456,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) /* if the integrated subsystem has been found automatically: */ len += sprintf(buf + len, "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"); - } else if ((speciale >= 0) && (speciale < (sizeof(subsys_list) / sizeof(struct subsys_list_struct)))) { + } else if ((speciale >= 0) && (speciale < ARRAY_SIZE(subsys_list))) { /* if the subsystem is a slot adapter */ len += sprintf(buf + len, "Adapter category: slot-card\n" "ROM Segment Address: "); if ((pos[2] & 0xf0) == 0xf0) @@ -1477,16 +1477,16 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id) while (len % sizeof(int) != (sizeof(int) - 1)) len += sprintf(buf + len, " "); len += sprintf(buf + len, "\n"); - + spin_unlock_irqrestore(shpnt->host_lock, flags); - + return len; } -int ibmmca_detect(Scsi_Host_Template * scsi_template) +int ibmmca_detect(struct scsi_host_template * scsi_template) { struct Scsi_Host *shpnt; - int port, id, i, j, k, list_size, slot; + int port, id, i, j, k, slot; int devices_on_irq_11 = 0; int devices_on_irq_14 = 0; int IRQ14_registered = 0; @@ -1603,8 +1603,7 @@ int ibmmca_detect(Scsi_Host_Template * scsi_template) /* now look for other adapters in MCA slots, */ /* determine the number of known IBM-SCSI-subsystem types */ /* see the pos[2] dependence to get the adapter port-offset. */ - list_size = sizeof(subsys_list) / sizeof(struct subsys_list_struct); - for (i = 0; i < list_size; i++) { + for (i = 0; i < ARRAY_SIZE(subsys_list); i++) { /* scan each slot for a fitting adapter id */ slot = 0; /* start at slot 0 */ while ((slot = mca_find_adapter(subsys_list[i].mca_id, slot)) @@ -1669,8 +1668,7 @@ int ibmmca_detect(Scsi_Host_Template * scsi_template) /* now check for SCSI-adapters, mapped to the integrated SCSI * area. E.g. a W/Cache in MCA-slot 9(!). Do the check correct here, * as this is a known effect on some models 95xx. */ - list_size = sizeof(subsys_list) / sizeof(struct subsys_list_struct); - for (i = 0; i < list_size; i++) { + for (i = 0; i < ARRAY_SIZE(subsys_list); i++) { /* scan each slot for a fitting adapter id */ slot = mca_find_adapter(subsys_list[i].mca_id, MCA_INTEGSCSI); if (slot != MCA_NOTFOUND) { /* scan through all slots */ @@ -1736,7 +1734,7 @@ int ibmmca_detect(Scsi_Host_Template * scsi_template) return found; /* return the number of found SCSI hosts. Should be 1 or 0. */ } -static struct Scsi_Host *ibmmca_register(Scsi_Host_Template * scsi_template, int port, int id, int adaptertype, char *hostname) +static struct Scsi_Host *ibmmca_register(struct scsi_host_template * scsi_template, int port, int id, int adaptertype, char *hostname) { struct Scsi_Host *shpnt; int i, j; @@ -2412,8 +2410,7 @@ static int ibmmca_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, spin_lock_irqsave(hosts[i]->host_lock, flags); /* Check it */ host_index = i; if (!shpnt) { - len += sprintf(buffer + len, "\nIBM MCA SCSI: Can't find adapter for host number %d\n", - shpnt->host_no); + len += sprintf(buffer + len, "\nIBM MCA SCSI: Can't find adapter"); return len; } max_pun = subsystem_maxid(host_index); @@ -2489,12 +2486,12 @@ static int option_setup(char *str) } ints[0] = i - 1; internal_ibmmca_scsi_setup(cur, ints); - return 0; + return 1; } __setup("ibmmcascsi=", option_setup); -static Scsi_Host_Template driver_template = { +static struct scsi_host_template driver_template = { .proc_name = "ibmmca", .proc_info = ibmmca_proc_info, .name = "IBM SCSI-Subsystem",