NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/46401: ISDN-driver for B1-card (iavc.c) does not compile on i386



>Number:         46401
>Category:       kern
>Synopsis:       ISDN-driver for B1-card (iavc.c) does not compile on i386
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 02 14:20:00 +0000 2012
>Originator:     Wolfgang.Stukenbrock%nagler-company.com@localhost
>Release:        NetBSD 5.1.2
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 4.0 NetBSD 4.0 (NSW-WS) #0: Tue Aug 17 17:28:09 CEST 
2010 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        The file /usr/src/dev/ic/iavc.c does not compile on i386 architecture.
        There are some warnings, that need correction ..

        cc1: warnings being treated as errors
        ../../../../dev/ic/iavc.c: In function 'iavc_receive_init':
        ../../../../dev/ic/iavc.c:624: warning: cast from pointer to integer of 
different size
        ../../../../dev/ic/iavc.c: In function 'iavc_handle_rx':
        ../../../../dev/ic/iavc.c:895: warning: pointer of type 'void *' used 
in arithmetic
        ../../../../dev/ic/iavc.c:895: warning: dereferencing 'void *' pointer
        ../../../../dev/ic/iavc.c: In function 'iavc_tx_capimsg':
        ../../../../dev/ic/iavc.c:1007: warning: pointer of type 'void *' used 
in arithmetic
        ../../../../dev/ic/iavc.c:1007: warning: dereferencing 'void *' pointer
        ../../../../dev/ic/iavc.c:1009: warning: pointer of type 'void *' used 
in arithmetic
        ../../../../dev/ic/iavc.c:1009: warning: dereferencing 'void *' pointer
        ../../../../dev/ic/iavc.c: In function 'iavc_tx_ctrlmsg':
        ../../../../dev/ic/iavc.c:1064: warning: pointer of type 'void *' used 
in arithmetic
        ../../../../dev/ic/iavc.c:1064: warning: dereferencing 'void *' pointer

>How-To-Repeat:
        setup an kernel with iavc configured and try to compile it.
>Fix:
        The following patch will solve the problem:

rcsdiff -r1.1 -u iavc.c  
===================================================================
RCS file: RCS/iavc.c,v
retrieving revision 1.1
diff -u -r1.1 iavc.c
--- iavc.c      2010/05/12 08:28:01     1.1
+++ iavc.c      2010/05/12 08:58:45
@@ -892,7 +892,7 @@
     u_int8_t *dmabuf = 0, cmd;
 
     if (sc->sc_dma) {
-       dmabuf = amcc_get_byte(&sc->sc_recvbuf[0], &cmd);
+       dmabuf = amcc_get_byte(sc->sc_recvbuf, &cmd);
     } else {
        cmd = iavc_get_byte(sc);
     }
@@ -1004,9 +1004,9 @@
        /* Copy message to DMA buffer. */
 
        if (m->m_next)
-           dmabuf = amcc_put_byte(&sc->sc_sendbuf[0], SEND_DATA_B3_REQ);
+           dmabuf = amcc_put_byte(sc->sc_sendbuf, SEND_DATA_B3_REQ);
        else
-           dmabuf = amcc_put_byte(&sc->sc_sendbuf[0], SEND_MESSAGE);
+           dmabuf = amcc_put_byte(sc->sc_sendbuf, SEND_MESSAGE);
 
        dmabuf = amcc_put_word(dmabuf, m->m_len);
        memcpy(dmabuf, m->m_data, m->m_len);
@@ -1061,7 +1061,7 @@
     uint8_t *dmabuf;
 
     if (sc->sc_dma) {
-       memcpy(&sc->sc_sendbuf[0], m->m_data + 2, m->m_len - 2);
+       memcpy(sc->sc_sendbuf, m->m_data + 2, m->m_len - 2);
        txlen = m->m_len - 2;
     } else {
 


>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index