Subject: backwards check
To: None <port-sparc64@netbsd.org>
From: Jason Wright <jason@thought.net>
List: port-sparc64
Date: 08/23/2001 11:19:14
While porting this code to OpenBSD, I noticed dmesg complaining about
"OF_mapintr failed".  The source is dev/pci_machdep.c and it looks like
the test for whether OF_mapintr failed is backwards.  Am I right, or
do I misunderstand?  Diff below.

--Jason L. Wright


Index: pci_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/dev/pci_machdep.c,v
retrieving revision 1.22
diff -u -r1.22 pci_machdep.c
--- pci_machdep.c	2001/07/20 00:07:13	1.22
+++ pci_machdep.c	2001/08/23 15:17:31
@@ -419,7 +419,7 @@
 	}
 
 	if (OF_mapintr(node, &interrupts, sizeof(interrupts), 
-		sizeof(interrupts)) > 0) {
+		sizeof(interrupts)) < 0) {
 		printf("OF_mapintr failed\n");
 	}
 	/* Try to find an IPL for this type of device. */