Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2013 15:00:07 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Andre Oppermann <andre@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r254805 - head/sys/sys
Message-ID:  <20130826110007.GR4574@FreeBSD.org>
In-Reply-To: <201308241958.r7OJwaxV031368@svn.freebsd.org>
References:  <201308241958.r7OJwaxV031368@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 24, 2013 at 07:58:36PM +0000, Andre Oppermann wrote:
A> Author: andre
A> Date: Sat Aug 24 19:58:36 2013
A> New Revision: 254805
A> URL: http://svnweb.freebsd.org/changeset/base/254805
A> 
A> Log:
A>   Add mtodo(m, o) macro taking an additional offset into the mbuf data section.
A>   
A>   Sponsored by:	The FreeBSD Foundation
A> 
A> Modified:
A>   head/sys/sys/mbuf.h
A> 
A> Modified: head/sys/sys/mbuf.h
A> ==============================================================================
A> --- head/sys/sys/mbuf.h	Sat Aug 24 19:51:18 2013	(r254804)
A> +++ head/sys/sys/mbuf.h	Sat Aug 24 19:58:36 2013	(r254805)
A> @@ -67,8 +67,10 @@
A>   * type:
A>   *
A>   * mtod(m, t)	-- Convert mbuf pointer to data pointer of correct type.
A> + * mtodo(m, o) -- Same as above but with offset 'o' into data.
A>   */
A>  #define	mtod(m, t)	((t)((m)->m_data))
A> +#define	mtodo(m, o)	((void *)(((m)->m_data) + (o)))

IMO, having a typecast would be better. Then mtodo() would be really same as
mtod(), as stated in comment.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130826110007.GR4574>