From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRuny-0005tg-NU for qemu-devel@nongnu.org; Wed, 01 Jun 2011 19:26:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRunw-0003iX-No for qemu-devel@nongnu.org; Wed, 01 Jun 2011 19:26:25 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:43283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRncQ-0005Wr-Ms for qemu-devel@nongnu.org; Wed, 01 Jun 2011 11:46:02 -0400 Received: by gxk26 with SMTP id 26so2705389gxk.4 for ; Wed, 01 Jun 2011 08:46:00 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DE65EB4.1070104@twiddle.net> Date: Wed, 01 Jun 2011 08:45:56 -0700 From: Richard Henderson MIME-Version: 1.0 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> In-Reply-To: <20110601153510.GA3339@localhost> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Eduard - Gabriel Munteanu 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, paul@codesourcery.com, kevin@koconnor.net, avi@redhat.com, dwg@au1.ibm.com, david@gibson.dropbear.id.au 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. Type safety this is not. r~