From owner-svn-src-all@FreeBSD.ORG Mon Aug 26 11:00:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 52C3253F; Mon, 26 Aug 2013 11:00:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D127A247E; Mon, 26 Aug 2013 11:00:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r7QB07nS059789; Mon, 26 Aug 2013 15:00:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r7QB078C059788; Mon, 26 Aug 2013 15:00:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 26 Aug 2013 15:00:07 +0400 From: Gleb Smirnoff To: Andre Oppermann Subject: Re: svn commit: r254805 - head/sys/sys Message-ID: <20130826110007.GR4574@FreeBSD.org> References: <201308241958.r7OJwaxV031368@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201308241958.r7OJwaxV031368@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2013 11:00:10 -0000 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.