Date: Thu, 22 Nov 2012 16:14:42 +0000 (UTC) From: Andre Oppermann <andre@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r243407 - in user/andre/tcp_workqueue/sys: dev/mxge sys Message-ID: <201211221614.qAMGEgaw017861@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andre Date: Thu Nov 22 16:14:41 2012 New Revision: 243407 URL: http://svnweb.freebsd.org/changeset/base/243407 Log: Omit the type casting parameter from mtodo() and cast through void * which then can be assigned to any other pointer type without warning from the compiler. Suggested by: mdf Modified: user/andre/tcp_workqueue/sys/dev/mxge/if_mxge.c user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/dev/mxge/if_mxge.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/mxge/if_mxge.c Thu Nov 22 15:38:09 2012 (r243406) +++ user/andre/tcp_workqueue/sys/dev/mxge/if_mxge.c Thu Nov 22 16:14:41 2012 (r243407) @@ -2098,7 +2098,7 @@ mxge_encap(struct mxge_slice_state *ss, if (m->m_pkthdr.csum_flags & (CSUM_IP_UDP|CSUM_IP_TCP)) { /* ensure ip header is in first mbuf, copy it to a scratch buffer if not */ - ip = mtodo(m, ip_off, struct ip *); + ip = mtodo(m, ip_off); cksum_offset = ip_off + (ip->ip_hl << 2); pseudo_hdr_offset = cksum_offset + m->m_pkthdr.csum_l3hlen; pseudo_hdr_offset = htobe16(pseudo_hdr_offset); Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Thu Nov 22 15:38:09 2012 (r243406) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Thu Nov 22 16:14:41 2012 (r243407) @@ -64,10 +64,10 @@ * type: * * mtod(m, t) -- Convert mbuf pointer to data pointer of correct type. - * mtodo(m, o, t) - Same as above but with offset 'o' into data. + * mtodo(m, o) -- Same as above but with offset 'o' into data. */ #define mtod(m, t) ((t)((m)->m_data)) -#define mtodo(m, o, t) ((t)(((m)->m_data) + (o))) +#define mtodo(m, o) ((void *)(((m)->m_data) + (o))) /* * Argument structure passed to UMA routines during mbuf and packet
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211221614.qAMGEgaw017861>