Subject: kern/29668: kernel compile error (GCC warnings) in ray(4)
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <fun@naobsd.org>
List: netbsd-bugs
Date: 03/12/2005 05:55:00
>Number:         29668
>Category:       kern
>Synopsis:       kernel compile error (GCC warnings) in ray(4)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 12 05:55:00 +0000 2005
>Originator:     FUKAUMI Naoki
>Release:        NetBSD 2.99.16
>Organization:
	FUKAUMI Naoki
>Environment:
System: NetBSD tr1.naobsd.org 2.99.16 NetBSD 2.99.16 (TR1) #1: Sun Feb 27 23:58:30 JST 2005 fun@tr1.naobsd.org:/home/fun/src/sys/arch/i386/compile/TR1 i386
Architecture: i386
Machine: i386
>Description:
	if_ray.c can't compile because GCC warns about arg type mismatch.
>How-To-Repeat:
	Compile custom kernel for OpenBlockS266 (evbppc) with ray(4).
>Fix:
	Cast some bus_size_t vars to long.

Index: sys/dev/pcmcia/if_ray.c
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/dev/pcmcia/if_ray.c,v
retrieving revision 1.56
diff -u -r1.56 if_ray.c
--- sys/dev/pcmcia/if_ray.c	27 Feb 2005 00:27:43 -0000	1.56
+++ sys/dev/pcmcia/if_ray.c	9 Mar 2005 02:55:40 -0000
@@ -1443,8 +1443,8 @@
 			len -= 4;
 #endif
 		ni = SRAM_READ_FIELD_1(sc, ccs, ray_cmd_rx, c_nextfrag);
-		RAY_DPRINTF(("%s: recv frag index %d len %ld bufp 0x%x ni %d\n",
-		    sc->sc_xname, i, (u_long)len, (int)bufp, ni));
+		RAY_DPRINTF(("%s: recv frag index %d len %ld bufp 0x%lx ni %d\n",
+		    sc->sc_xname, i, (u_long)len, (long)bufp, ni));
 		if (len + lenread > pktlen) {
 			RAY_DPRINTF(("%s: BAD LEN current 0x%lx pktlen 0x%lx\n",
 			    sc->sc_xname, (u_long)(len + lenread),
@@ -1740,7 +1740,7 @@
 		SRAM_WRITE_FIELD_1(sc, RAY_GET_CCS(pi), ray_cmd_tx, c_link, i);
 
 	RAY_DPRINTF(("%s: ray_alloc_tx_ccs bufp 0x%lx idx %d pidx %d \n",
-	    sc->sc_xname, bufp, i, pi));
+	    sc->sc_xname, (long)bufp, i, pi));
 
 	return (bufp + RAY_TX_PHY_SIZE);
 }
@@ -1868,7 +1868,7 @@
 			stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
 			RAY_DPRINTF(("%s: check ccs idx %d ccs 0x%lx "
 			    "cmd 0x%x stat %d\n", sc->sc_xname, i,
-			    ccs, cmd, stat));
+			    (long)ccs, cmd, stat));
 			goto breakout;
 		}
 	}
@@ -1948,7 +1948,7 @@
 	stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
 
 	RAY_DPRINTF(("%s: ray_ccs_done idx %ld cmd 0x%x stat %d\n",
-	    sc->sc_xname, RAY_GET_INDEX(ccs), cmd, stat));
+	    sc->sc_xname, RAY_GET_INDEX((long)ccs), cmd, stat));
 
 	rcmd = 0;
 	switch (cmd) {
@@ -2049,7 +2049,7 @@
 	stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
 
 	RAY_DPRINTF(("%s: ray_rccs_intr idx %ld cmd 0x%x stat %d\n",
-	    sc->sc_xname, RAY_GET_INDEX(ccs), cmd, stat));
+	    sc->sc_xname, RAY_GET_INDEX((long)ccs), cmd, stat));
 
 	rcmd = 0;
 	switch (cmd) {
@@ -2169,7 +2169,7 @@
 	u_int8_t stat;
 
 	RAY_DPRINTF(("%s: free_ccs idx %ld\n", sc->sc_xname,
-	    RAY_GET_INDEX(ccs)));
+	    RAY_GET_INDEX((long)ccs)));
 
 	stat = SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_status);
 	SRAM_WRITE_FIELD_1(sc, ccs, ray_cmd, c_status, RAY_CCS_STATUS_FREE);