From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS4NA-0004pL-6i for qemu-devel@nongnu.org; Thu, 02 Jun 2011 05:39:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS4N8-0000K6-DD for qemu-devel@nongnu.org; Thu, 02 Jun 2011 05:39:23 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:37225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS4N7-0000Jt-I5 for qemu-devel@nongnu.org; Thu, 02 Jun 2011 05:39:22 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp01.au.ibm.com (8.14.4/8.13.1) with ESMTP id p529Ysqa028308 for ; Thu, 2 Jun 2011 19:34:54 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p529d7sG1020086 for ; Thu, 2 Jun 2011 19:39:07 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p529d65p000423 for ; Thu, 2 Jun 2011 19:39:06 +1000 Date: Thu, 2 Jun 2011 19:38:42 +1000 From: David Gibson Message-ID: <20110602093842.GE5998@yookeroo.fritz.box> References: <1306892315-7306-1-git-send-email-eduard.munteanu@linux360.ro> <1306892315-7306-2-git-send-email-eduard.munteanu@linux360.ro> <4DE64646.3010505@twiddle.net> <20110601145227.GA2936@localhost> <4DE65629.1010300@twiddle.net> <20110601153510.GA3339@localhost> <4DE65EB4.1070104@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DE65EB4.1070104@twiddle.net> Subject: Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, mst@redhat.com, aik@ozlabs.ru, joro@8bytes.org, seabios@seabios.org, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, yamahata@valinux.co.jp, kevin@koconnor.net, avi@redhat.com, Eduard - Gabriel Munteanu , paul@codesourcery.com On Wed, Jun 01, 2011 at 08:45:56AM -0700, Richard Henderson wrote: > On 06/01/2011 08:35 AM, Eduard - Gabriel Munteanu wrote: > > Maybe it's not nice, but you're missing the fact upcasting gives you > > some type safety. With opaques you have none. > > Lol. Do you understand what container_of does? > This is not dynamic_cast<> with RTTI. > > You can put any type name in there that you like, > so long as it has a field name to match. The type > of the field you give doesn't even have to match > the type of the pointer that you pass in. Uh, if that's true, that's a bug in the container_of implementation. The ccan container_of implementation, for example, certainly does check that the given field has type matching the pointer. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson