From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfYDB-00064J-A4 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 07:59:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfYD6-0005w8-4P for qemu-devel@nongnu.org; Mon, 24 Aug 2009 07:59:44 -0400 Received: from [199.232.76.173] (port=52696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfYD5-0005vi-TL for qemu-devel@nongnu.org; Mon, 24 Aug 2009 07:59:39 -0400 Received: from mx20.gnu.org ([199.232.41.8]:1171) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MfYD5-0007Sa-Hb for qemu-devel@nongnu.org; Mon, 24 Aug 2009 07:59:39 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfYD4-0003Af-Ni for qemu-devel@nongnu.org; Mon, 24 Aug 2009 07:59:39 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State Date: Mon, 24 Aug 2009 12:59:06 +0100 References: <1250843494-28326-1-git-send-email-armbru@redhat.com> <1250843494-28326-3-git-send-email-armbru@redhat.com> In-Reply-To: <1250843494-28326-3-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200908241259.06409.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster > /* Device state. */ > struct I6300State { > - PCIDevice dev; /* PCI device state, must be first field. */ > + PCIDevice dev; >... > - I6300State *d = (I6300State *) dev; > + I6300State *d = container_of(dev, I6300State, dev); I'm pretty sure this is wrong, and code elsewhere still requires the PCIDevice be the first field in I6300State. e.g. i6300esb_pc_init. Did you actually try putting dev at a nonzero offset? Paul