From patchwork Fri Aug 21 08:31:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 31809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id BAB81B7BB7 for ; Fri, 21 Aug 2009 18:32:21 +1000 (EST) Received: from localhost ([127.0.0.1]:34152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MePXj-0006cI-V1 for incoming@patchwork.ozlabs.org; Fri, 21 Aug 2009 04:32:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MePXD-0006bm-W5 for qemu-devel@nongnu.org; Fri, 21 Aug 2009 04:31:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MePX9-0006aE-3C for qemu-devel@nongnu.org; Fri, 21 Aug 2009 04:31:43 -0400 Received: from [199.232.76.173] (port=38062 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MePX8-0006aB-U9 for qemu-devel@nongnu.org; Fri, 21 Aug 2009 04:31:38 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:38610) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MePX8-0007Iy-Ed for qemu-devel@nongnu.org; Fri, 21 Aug 2009 04:31:38 -0400 Received: from pike.pond.sub.org (pD9E39621.dip.t-dialin.net [217.227.150.33]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 28334276D38 for ; Fri, 21 Aug 2009 10:31:35 +0200 (CEST) Received: by pike.pond.sub.org (Postfix, from userid 1000) id A55E010091; Fri, 21 Aug 2009 10:31:34 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 21 Aug 2009 10:31:33 +0200 Message-Id: <1250843494-28326-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1250843494-28326-1-git-send-email-armbru@redhat.com> References: <1250843494-28326-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Markus Armbruster --- hw/wdt_i6300esb.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c index 5e9fd7c..2227303 100644 --- a/hw/wdt_i6300esb.c +++ b/hw/wdt_i6300esb.c @@ -25,7 +25,6 @@ #include "qemu-timer.h" #include "watchdog.h" #include "hw.h" -#include "isa.h" #include "pc.h" #include "pci.h" @@ -71,7 +70,7 @@ /* Device state. */ struct I6300State { - PCIDevice dev; /* PCI device state, must be first field. */ + PCIDevice dev; int reboot_enabled; /* "Reboot" on timer expiry. The real action * performed depends on the -watchdog-action @@ -199,7 +198,7 @@ static void i6300esb_timer_expired(void *vp) static void i6300esb_config_write(PCIDevice *dev, uint32_t addr, uint32_t data, int len) { - I6300State *d = (I6300State *) dev; + I6300State *d = container_of(dev, I6300State, dev); int old; i6300esb_debug("addr = %x, data = %x, len = %d\n", addr, data, len); @@ -227,7 +226,7 @@ static void i6300esb_config_write(PCIDevice *dev, uint32_t addr, static uint32_t i6300esb_config_read(PCIDevice *dev, uint32_t addr, int len) { - I6300State *d = (I6300State *) dev; + I6300State *d = container_of(dev, I6300State, dev); uint32_t data; i6300esb_debug ("addr = %x, len = %d\n", addr, len); @@ -361,7 +360,7 @@ static void i6300esb_map(PCIDevice *dev, int region_num, i6300esb_mem_writew, i6300esb_mem_writel, }; - I6300State *d = (I6300State *) dev; + I6300State *d = container_of(dev, I6300State, dev); int io_mem; i6300esb_debug("addr = %x, size = %x, type = %d\n", addr, size, type);