On Wed, 2009-03-18 at 16:43 +0100, Stefan Richter wrote: > Konrad Rzeszutek wrote: > > .. snip.. > >> + {TYPE_ANY, "HP", "HSV300" }, > >> + {TYPE_ANY, "IBM", "2107900" }, > >> + {TYPE_ANY, "IBM", "2145" }, > >> + {TYPE_ANY, "Pillar", "Axiom" }, > >> + {0, "", ""}, > > > > Is there a define for '0' value? > > This is an array terminator. Almost nobody uses cpp defines for > terminating values. (In this case, the actual terminator is "" in the > 2nd struct member.) > > BTW, Peter, > > >> --- linux-2.6.28.orig/drivers/scsi/device_handler/scsi_dh.c > >> +++ linux-2.6.28/drivers/scsi/device_handler/scsi_dh.c > >> @@ -75,7 +75,10 @@ static int scsi_dh_handler_lookup(struct > >> { > >> int i, found = 0; > >> > >> - for(i = 0; scsi_dh->devlist[i].vendor; i++) { > >> + for(i = 0; scsi_dh->devlist[i].vendor[0]; i++) { > >> + if ((scsi_dh->devlist[i].type != TYPE_ANY) && > >> + (scsi_dh->devlist[i].type != sdev->type)) > >> + continue; > >> if (!strncmp(sdev->vendor, scsi_dh->devlist[i].vendor, > >> strlen(scsi_dh->devlist[i].vendor)) && > >> !strncmp(sdev->model, scsi_dh->devlist[i].model, > > AFAICS you could have kept the check for .vendor != NULL instead of > .vendor[0] != '\0' and write the terminator thusly: > > {}, > > Saves the space for a one byte long string in the object files. :-) Tried it after your response. Got a panic :(. Did I code your suggestion correctly ? Here is the patch -------------- Index: linux-2.6.29-rc8/drivers/scsi/device_handler/scsi_dh.c =================================================================== --- linux-2.6.29-rc8.orig/drivers/scsi/device_handler/scsi_dh.c +++ linux-2.6.29-rc8/drivers/scsi/device_handler/scsi_dh.c @@ -75,7 +75,7 @@ static int scsi_dh_handler_lookup(struct { int i, found = 0; - for(i = 0; scsi_dh->devlist[i].vendor[0]; i++) { + for(i = 0; scsi_dh->devlist[i].vendor; i++) { if ((scsi_dh->devlist[i].type != TYPE_ANY) && (scsi_dh->devlist[i].type != sdev->type)) continue; Index: linux-2.6.29-rc8/drivers/scsi/device_handler/scsi_dh_rdac.c =================================================================== --- linux-2.6.29-rc8.orig/drivers/scsi/device_handler/scsi_dh_rdac.c +++ linux-2.6.29-rc8/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -604,7 +604,7 @@ static const struct scsi_dh_device_id rd {TYPE_ANY, "DELL", "MD3000i"}, {TYPE_ANY, "LSI", "INF-01-00"}, {TYPE_ANY, "ENGENIO", "INF-01-00"}, - {0, "", ""}, + {}, }; MODULE_DEVICE_TABLE(scsi_dh, rdac_dev_list); -------------- Here is the panic -------------- Faulting instruction address: 0xd0000000017e01c4 cpu 0x0: Vector: 300 (Data Access) at [c0000000e2fbb680] pc: d0000000017e01c4: .scsi_dh_handler_lookup+0x24/0xc0 [scsi_dh] lr: d0000000017e0200: .scsi_dh_handler_lookup+0x60/0xc0 [scsi_dh] sp: c0000000e2fbb900 msr: 8000000000009032 dar: d000000002f80017 dsisr: 40000000 current = 0xc0000000e7a84200 paca = 0xc000000000723400 pid = 3516, comm = modprobe enter ? for help [c0000000e2fbb900] c0000000e2fbb9e0 (unreliable) [c0000000e2fbb9a0] d0000000017e0604 .device_handler_match+0x110/0x278 [scsi_dh] [c0000000e2fbba50] d0000000017e0bd0 .scsi_dh_notifier_add+0x54/0x94 [scsi_dh] [c0000000e2fbbae0] c0000000002d9d40 .bus_for_each_dev+0x80/0xd8 [c0000000e2fbbb90] d0000000017e0dc0 .scsi_register_device_handler +0x90/0xcc [scsi_dh] [c0000000e2fbbc20] d000000002f70ce8 .rdac_init+0x20/0x4d8 [scsi_dh_rdac] [c0000000e2fbbca0] c0000000000090b0 .do_one_initcall+0x90/0x1a8 [c0000000e2fbbd90] c0000000000a0b28 .SyS_init_module+0xc4/0x214 [c0000000e2fbbe30] c000000000008534 syscall_exit+0x0/0x40 --- Exception: c00 (System Call) at 000000000ff11a6c SP (ffb6f7e0) is in userspace 0:mon> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html