qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] i440fx: implement reset


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] i440fx: implement reset
Date: Wed, 20 Feb 2013 18:42:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 20.02.2013 18:24, schrieb David Woodhouse:
> On Wed, 2013-02-20 at 17:17 +0100, Andreas Färber wrote:
>>> +static void i440fx_reset(DeviceState *ds)
>>> +{
>>> +    PCIDevice *dev = DO_UPCAST(PCIDevice, qdev, ds);
>>> +    PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev);
>>
>> Please don't use DO_UPCAST() on QOM objects, there's QOM cast macros for
>> this, like PCI_DEVICE(). If there's one missing for PCII440FXState (I
>> think I only added them for the PHB itself?), it's two lines to add.
> 
> Would you care to elaborate on exactly what those two lines would look
> like? Being *completely* unfamiliar with qemu code, it took me long
> enough to work out the DO_UPCAST version.

static void i440fx_reset(DeviceState *dev)
{
    PCIDevice *pci = PCI_DEVICE(dev);
    PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev);

HTH,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]