From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STvPL-0006yP-ER for qemu-devel@nongnu.org; Mon, 14 May 2012 09:33:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STvPE-00058l-IB for qemu-devel@nongnu.org; Mon, 14 May 2012 09:33:51 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:56765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STvPE-00054t-CA for qemu-devel@nongnu.org; Mon, 14 May 2012 09:33:44 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 May 2012 07:33:34 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 15AA11FF001A for ; Mon, 14 May 2012 07:33:30 -0600 (MDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4EDXO9v120134 for ; Mon, 14 May 2012 07:33:25 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4EDX1Vm031107 for ; Mon, 14 May 2012 07:33:01 -0600 Message-ID: <4FB10989.1040709@us.ibm.com> Date: Mon, 14 May 2012 08:32:57 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1336749740-18474-1-git-send-email-armbru@redhat.com> <1336749740-18474-2-git-send-email-armbru@redhat.com> In-Reply-To: <1336749740-18474-2-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/2] Un-inline fdctrl_init_isa() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, hpoussin@reactos.org, qemu-devel@nongnu.org On 05/11/2012 10:22 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster Reviewed-by: Anthony Liguori I know this is a pervasive idiom, but it makes little sense to me and I've got a number of similar changes queued up myself. Regards, Anthony Liguori > --- > hw/fdc.c | 20 ++++++++++++++++++++ > hw/fdc.h | 24 ++---------------------- > hw/ide/piix.c | 3 ++- > hw/isa.h | 2 -- > hw/pc_sysfw.c | 1 + > qemu-common.h | 1 + > 6 files changed, 26 insertions(+), 25 deletions(-) > > diff --git a/hw/fdc.c b/hw/fdc.c > index cb4cd25..d9c4fbf 100644 > --- a/hw/fdc.c > +++ b/hw/fdc.c > @@ -1886,6 +1886,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl) > return 0; > } > > +ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds) > +{ > + ISADevice *dev; > + > + dev = isa_try_create(bus, "isa-fdc"); > + if (!dev) { > + return NULL; > + } > + > + if (fds[0]) { > + qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); > + } > + if (fds[1]) { > + qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); > + } > + qdev_init_nofail(&dev->qdev); > + > + return dev; > +} > + > void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, > target_phys_addr_t mmio_base, DriveInfo **fds) > { > diff --git a/hw/fdc.h b/hw/fdc.h > index 55a8d73..1b32b17 100644 > --- a/hw/fdc.h > +++ b/hw/fdc.h > @@ -1,32 +1,12 @@ > #ifndef HW_FDC_H > #define HW_FDC_H > > -#include "isa.h" > -#include "blockdev.h" > +#include "qemu-common.h" > > /* fdc.c */ > #define MAX_FD 2 > > -static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds) > -{ > - ISADevice *dev; > - > - dev = isa_try_create(bus, "isa-fdc"); > - if (!dev) { > - return NULL; > - } > - > - if (fds[0]) { > - qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); > - } > - if (fds[1]) { > - qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); > - } > - qdev_init_nofail(&dev->qdev); > - > - return dev; > -} > - > +ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds); > void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, > target_phys_addr_t mmio_base, DriveInfo **fds); > void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base, > diff --git a/hw/ide/piix.c b/hw/ide/piix.c > index bcaa400..f5a74c2 100644 > --- a/hw/ide/piix.c > +++ b/hw/ide/piix.c > @@ -22,11 +22,12 @@ > * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > * THE SOFTWARE. > */ > + > #include > #include > #include > #include > -#include "block.h" > +#include "blockdev.h" > #include "sysemu.h" > #include "dma.h" > > diff --git a/hw/isa.h b/hw/isa.h > index f7bc4b5..6c6fd7f 100644 > --- a/hw/isa.h > +++ b/hw/isa.h > @@ -9,8 +9,6 @@ > > #define ISA_NUM_IRQS 16 > > -typedef struct ISADevice ISADevice; > - > #define TYPE_ISA_DEVICE "isa-device" > #define ISA_DEVICE(obj) \ > OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE) > diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c > index f0d7c21..b45f0ac 100644 > --- a/hw/pc_sysfw.c > +++ b/hw/pc_sysfw.c > @@ -23,6 +23,7 @@ > * THE SOFTWARE. > */ > > +#include "blockdev.h" > #include "sysbus.h" > #include "hw.h" > #include "pc.h" > diff --git a/qemu-common.h b/qemu-common.h > index cccfb42..0bb1078 100644 > --- a/qemu-common.h > +++ b/qemu-common.h > @@ -239,6 +239,7 @@ typedef struct VLANState VLANState; > typedef struct VLANClientState VLANClientState; > typedef struct i2c_bus i2c_bus; > typedef struct ISABus ISABus; > +typedef struct ISADevice ISADevice; > typedef struct SMBusDevice SMBusDevice; > typedef struct PCIHostState PCIHostState; > typedef struct PCIExpressHost PCIExpressHost;