Thread (1 message) 1 message, 1 author, 2004-12-27

Re: PATCH: (Discussion) Stop IDE legacy ISA probes on PCI systems

From: <hidden>
Date: 2004-12-27 22:18:34
Also in: lkml

On Mon, 27 Dec 2004 21:15:26 GMT, Adam Sampson said:
Alan Cox [off-list ref] writes:
quoted
 	switch (index) {
 		case 0:	return 0x1f0;
 		case 1:	return 0x170;
+		
+		if(pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
+			case 2: return 0x1e8;
+			case 3: return 0x168;
+			case 4: return 0x1e0;
+			case 5: return 0x160;
+		}
+
 		default:
 			return 0;
 	}
I don't think that code will have the intended effect, unless your
GCC has some funny ideas about switch statements...
Those who don't understand the Duff Device are doomed to re-invent it, poorly. ;)

(Yes Alan, I know *you* know C well enough, but I just looked at that block
of code and it looked *so* much like Tom Duff's that I had to say it. ;)

For those not in the know:

http://www.lysator.liu.se/c/duffs-device.html

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help