powerpc.LINT* broken in netmap(4)

Vincenzo Maffione v.maffione at gmail.com
Fri Jan 13 10:46:30 UTC 2017


Hi,
  Thanks for reporting. The warning is innocuous, but I'm not sure how to
silence it. Maybe

diff --git a/sys/dev/netmap/netmap_generic.c
b/sys/dev/netmap/netmap_generic.c
index cb1cff1f0e7..226a0864fd0 100644
--- a/sys/dev/netmap/netmap_generic.c
+++ b/sys/dev/netmap/netmap_generic.c
@@ -168,7 +168,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len)
 static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { }

 #define SET_MBUF_DESTRUCTOR(m, fn)     do {            \
-       (m)->m_ext.ext_free = fn ? (void *)fn : (void *)void_mbuf_dtor; \
+       (m)->m_ext.ext_free = (fn != NULL) ? (void *)fn : (void
*)void_mbuf_dtor;   \
 } while (0)

 static inline struct mbuf *


or we could turn SET_MBUF_DESTRUCTOR into a real function.

Cheers,
  VIncenzo

2017-01-13 11:22 GMT+01:00 Ngie Cooper (yaneurabeya) <yaneurabeya at gmail.com>
:

> Hi,
>         I spotted these compilation errors on universe12a.freebsd.org for
> both powerpc.LINT and powerpc.LINT64:
>
> cc1: warnings being treated as errors
> /scratch/tmp/ngie/svn/sys/dev/netmap/netmap_generic.c: In function
> 'generic_set_tx_event':
> /scratch/tmp/ngie/svn/sys/dev/netmap/netmap_generic.c:765: warning: the
> address of 'generic_mbuf_destructor' will always evaluate as 'true'
> [-Waddress]
> --- netmap_generic.o ---
> *** [netmap_generic.o] Error code 1
>
>         I haven’t yet dug into why this only surfaces on powerpc, yet…
> Thanks,
> -Ngie
>



-- 
Vincenzo Maffione


More information about the freebsd-ppc mailing list